From 61719705559a38610d870292d8b2240e1b339eaf Mon Sep 17 00:00:00 2001 From: Quotengrote <38253905+quotengrote@users.noreply.github.com> Date: Thu, 12 Nov 2020 14:46:27 +0100 Subject: [PATCH] Sanoid - 5-minute-Snapshots (#66) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * neue Snapshots eingebaut, alle 5 Minuten * Einrückungen Sanoid --- inventories/group_vars/virt.yml | 5 +++-- roles/mgrote.sanoid/templates/sanoid-cron.sh | 19 +++++++++---------- roles/mgrote.sanoid/templates/sanoid.conf.j2 | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-) 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 }}