diff options
author | Kenny Ballou <kb@devnulllabs.io> | 2022-10-17 16:47:34 -0600 |
---|---|---|
committer | Kenny Ballou <kb@devnulllabs.io> | 2022-10-17 16:47:34 -0600 |
commit | dbbc26a34caa52de879150342c005638a99748da (patch) | |
tree | 7f9fe3fe3086319aaa22528f7552fd92e8249a0d /kbg | |
parent | ae4962a7cd513ddd86b04f46fa6fd423e8412064 (diff) | |
download | dotfiles-dbbc26a34caa52de879150342c005638a99748da.tar.gz dotfiles-dbbc26a34caa52de879150342c005638a99748da.tar.xz |
services: mcron: split jobs and update service type
Signed-off-by: Kenny Ballou <kb@devnulllabs.io>
Diffstat (limited to 'kbg')
-rw-r--r-- | kbg/services/mcron.scm | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/kbg/services/mcron.scm b/kbg/services/mcron.scm index 9757c161..4b5af849 100644 --- a/kbg/services/mcron.scm +++ b/kbg/services/mcron.scm @@ -14,43 +14,48 @@ #:use-module (mcron job-specifier) #:export (mcron-service)) +(define borg-backup-job + #~(job "0 * 0 0 0" + (lambda () + (system (string-append borg "/bin/borg") + "create" + "--stats" + "--progress" + "--show-rc" + "--compression lz4" + "--exclude-caches" + "--exclude 'node_modules'" + "--exclude '/home/*/.cache/*'" + "--exclude '/home/*/tmp/*'" + "--exclude '/home/*/guixtest/*'" + "--exclude '/home/*/.var/*'" + "--exclude '/home/*/.config/Element/*'" + "--exclude '/home/*/.config/Signal/*'" + "--exclude '/home/*/.config/Slack/*'" + "--exclude '/home/*/.local/share/Zeal/*'" + "--remote-ratelimit 2048" + (string-append %borg-repository "::$(hostname)-$(uuidgen --time)" + "/home/kb/"))) + "Borg Backup Creation")) + +(define borg-backup-prune-job + #~(job "10 * 0 0 0" + (lambda () + (system (string-append borg "/bin/borg") + "prune" + "--stats" + "--progress" + "--show-rc" + "--keep-hourly=24" + "--keep-daily=7" + "--keep-weakly=4" + "--keep-monthly=6" + "--keep-yearly=2" + "--prefix=$(hostname)" + %borg-repository)) + "Borg Backup Pruning")) + (define mcron-service - (list (service home-mcron-service-type - (home-mcron-configuration - (jobs (list #~(job "0 * 0 0 0" - (lambda () - (system (string-append borg "/bin/borg") - "create" - "--stats" - "--progress" - "--show-rc" - "--compression lz4" - "--exclude-caches" - "--exclude 'node_modules'" - "--exclude '/home/*/.cache/*'" - "--exclude '/home/*/tmp/*'" - "--exclude '/home/*/guixtest/*'" - "--exclude '/home/*/.var/*'" - "--exclude '/home/*/.config/Element/*'" - "--exclude '/home/*/.config/Signal/*'" - "--exclude '/home/*/.config/Slack/*'" - "--exclude '/home/*/.local/share/Zeal/*'" - "--remote-ratelimit 2000" - (string-append %borg-repository "::$(hostname)-$(uuidgen --time)" - "/home/kb/"))) - "Borg Backup Creation") - #~(job "10 * 0 0 0" - (lambda () - (system (string-append borg "/bin/borg") - "prune" - "--stats" - "--progress" - "--show-rc" - "--keep-hourly=24" - "--keep-daily=7" - "--keep-weakly=4" - "--keep-monthly=6" - "--keep-yearly=2" - "--prefix=$(hostname)" - %borg-repository)) - "Borg Backup Pruning"))))))) + (list (simple-service 'home-mcron + home-mcron-service-type + (list borg-backup-job borg-backup-prune-job)))) |