snapshot: add cron for btrbk

This commit is contained in:
Hoang Nguyen 2023-06-18 00:00:00 +07:00
parent 2d6a1bb57d
commit 386fdb9280
Signed by: folliehiyuki
GPG Key ID: B0567C20730E9B11
2 changed files with 15 additions and 1 deletions

View File

@ -168,8 +168,11 @@ snapper:
# NOTE: some caveats to reduce config complexity
# - use the same targets for all subvolumes in each volume definition
# - use the same global retention policy for snapshot/backup/archive
# - there's only 1 global ssh config
# - there's only 1 global ssh config, 1 global crontab
btrbk:
cron:
hourly: snapshot
daily: resume
options:
lockfile: /var/lock/btrbk.lock
logfile: /var/log/btrbk.log

View File

@ -13,3 +13,14 @@
group: root
notify:
- Create snapshots btrfs subvolumes manually
- name: btrbk | Create btrbk crontabs
copy:
content: |
#!/bin/sh
TZ=UTC exec /usr/bin/btrbk -q {{ item.value }}
dest: /etc/periodic/{{ item.key }}/btrbk
mode: '755'
owner: root
group: root
loop: '{{ btrbk.cron | dict2items }}'