diff --git a/inventories/group_vars/virt.yml b/inventories/group_vars/virt.yml index b3c0294a..a03611ab 100644 --- a/inventories/group_vars/virt.yml +++ b/inventories/group_vars/virt.yml @@ -11,12 +11,13 @@ - .tmux.conf - .gitconfig ### mgrote.sanoid - sanoid_snapshot_keep_hourly: '24' sanoid_zfs_recursive: 'yes' - sanoid_cron_minutes: '10,20,30,40,50,59' sanoid_zfs_dataset: "hdd_data_raidz/data" + sanoid_snapshot_interval_underhour: '5' + sanoid_snapshot_keep_underhour: '36' sanoid_snapshot_keep_daily: '31' sanoid_snapshot_keep_monthly: '6' + sanoid_snapshot_keep_hourly: '24' ### mgrote.smart smart_smartctlmail_cron_minutes: "15" smart_smartctlmail_cron_hours: "6" diff --git a/roles/mgrote.sanoid/templates/sanoid-cron.sh b/roles/mgrote.sanoid/templates/sanoid-cron.sh index 92f95b28..fb649833 100644 --- a/roles/mgrote.sanoid/templates/sanoid-cron.sh +++ b/roles/mgrote.sanoid/templates/sanoid-cron.sh @@ -22,16 +22,15 @@ function unlock() { exlock ( - echo "--------------------------------------------------" - echo $(date) sanoid start - - echo "" -/usr/local/bin/sanoid --cron --verbose - echo "" - zfs list hdd_data_raidz/data -o space -t snapshot -zfs list hdd_data_raidz/data/videos -o space -t snapshot - echo $(date) sanoid end - echo "--------------------------------------------------" + echo "--------------------------------------------------" + echo $(date) sanoid start + echo "" + /usr/local/bin/sanoid --cron --verbose + echo "" + zfs list hdd_data_raidz/data -o space -t snapshot + zfs list hdd_data_raidz/data/videos -o space -t snapshot + echo $(date) sanoid end + echo "--------------------------------------------------" ) >> /var/log/sanoid-cron.log 2>&1 & diff --git a/roles/mgrote.sanoid/templates/sanoid.conf.j2 b/roles/mgrote.sanoid/templates/sanoid.conf.j2 index c612be13..57dff5e2 100644 --- a/roles/mgrote.sanoid/templates/sanoid.conf.j2 +++ b/roles/mgrote.sanoid/templates/sanoid.conf.j2 @@ -10,6 +10,9 @@ daily = {{ sanoid_snapshot_keep_daily }} monthly = {{ sanoid_snapshot_keep_monthly }} yearly = {{ sanoid_snapshot_keep_yearly }} + ## Underhour - Snapshots + frequent_period = {{ sanoid_snapshot_interval_underhour }} + frequently = {{ sanoid_snapshot_keep_underhour }} ## Other Options autosnap = {{ sanoid_auto_snap }} autoprune = {{ sanoid_auto_prune }}