From 58733e075badb2e007a9c1570f424af6aaa6fcdb Mon Sep 17 00:00:00 2001 From: Tim Foster Date: Thu, 25 Sep 2008 17:23:43 +0100 Subject: [PATCH] Reorder manifests so :default gets added first, clean up instance manifests, remove old sample instances check_missed_snapshots should not use print_log --- src/lib/svc/method/zfs-auto-snapshot | 4 +- src/prototype | 16 +++-- src/samples/auto-snapshot-space-archive.xml | 12 ---- .../auto-snapshot-space-timf,backup.xml | 12 ---- .../auto-snapshot-space-timf,daily.xml | 68 ------------------- .../auto-snapshot-space-timf,frequent.xml | 68 ------------------- .../auto-snapshot-space-timf,monthly.xml | 68 ------------------- src/samples/auto-snapshot-tank-rootfs.xml | 68 ------------------- ...fs-auto-snapshot.xml => auto-snapshot.xml} | 46 ++++++------- ...-daily.xml => zfs-auto-snapshot-daily.xml} | 24 ------- ...ent.xml => zfs-auto-snapshot-frequent.xml} | 24 ------- ...ourly.xml => zfs-auto-snapshot-hourly.xml} | 24 ------- ...thly.xml => zfs-auto-snapshot-monthly.xml} | 24 ------- ...eekly.xml => zfs-auto-snapshot-weekly.xml} | 24 ------- 14 files changed, 33 insertions(+), 449 deletions(-) delete mode 100644 src/samples/auto-snapshot-space-timf,daily.xml delete mode 100644 src/samples/auto-snapshot-space-timf,frequent.xml delete mode 100644 src/samples/auto-snapshot-space-timf,monthly.xml delete mode 100644 src/samples/auto-snapshot-tank-rootfs.xml rename src/var/svc/manifest/system/filesystem/{zfs-auto-snapshot.xml => auto-snapshot.xml} (98%) mode change 100755 => 100644 rename src/var/svc/manifest/system/filesystem/{auto-snapshot-daily.xml => zfs-auto-snapshot-daily.xml} (69%) rename src/var/svc/manifest/system/filesystem/{auto-snapshot-frequent.xml => zfs-auto-snapshot-frequent.xml} (66%) rename src/var/svc/manifest/system/filesystem/{auto-snapshot-hourly.xml => zfs-auto-snapshot-hourly.xml} (66%) rename src/var/svc/manifest/system/filesystem/{auto-snapshot-monthly.xml => zfs-auto-snapshot-monthly.xml} (66%) rename src/var/svc/manifest/system/filesystem/{auto-snapshot-weekly.xml => zfs-auto-snapshot-weekly.xml} (66%) diff --git a/src/lib/svc/method/zfs-auto-snapshot b/src/lib/svc/method/zfs-auto-snapshot index 4f330df..ebea3e1 100755 --- a/src/lib/svc/method/zfs-auto-snapshot +++ b/src/lib/svc/method/zfs-auto-snapshot @@ -384,8 +384,8 @@ function check_missed_snapshots { # $INTERVAL $PERIOD $FMRI PERIOD_S=$(( $MULTIPLIER * $PERIOD )) AGO=$(( $NOW - $LAST_SNAP_TIME )) if [ $AGO -gt $PERIOD_S ] ; then - print_log "Last snapshot for $FMRI taken on $LAST_SNAP_TIME_HUMAN" - print_log "which was greater than the $PERIOD $INTERVAL schedule. Taking snapshot now." + echo "Last snapshot for $FMRI taken on $LAST_SNAP_TIME_HUMAN" + echo "which was greater than the $PERIOD $INTERVAL schedule. Taking snapshot now." take_snapshot $FMRI $NO_CACHE_REPOPULATE fi } diff --git a/src/prototype b/src/prototype index 795460d..5967cd5 100644 --- a/src/prototype +++ b/src/prototype @@ -13,9 +13,13 @@ d none var/svc 0755 root sys d none var/svc/manifest 0755 root sys d none var/svc/manifest/system 0755 root sys d none var/svc/manifest/system/filesystem 0755 root sys -f manifest var/svc/manifest/system/filesystem/zfs-auto-snapshot.xml 0644 root sys -f manifest var/svc/manifest/system/filesystem/auto-snapshot-monthly.xml 0644 root sys -f manifest var/svc/manifest/system/filesystem/auto-snapshot-frequent.xml 0644 root sys -f manifest var/svc/manifest/system/filesystem/auto-snapshot-daily.xml 0644 root sys -f manifest var/svc/manifest/system/filesystem/auto-snapshot-hourly.xml 0644 root sys -f manifest var/svc/manifest/system/filesystem/auto-snapshot-weekly.xml 0644 root sys +# The order here is important: the auto-snapshot.xml manifest +# must be imported before the instance manifests, otherwise +# dependency information isn't set in the instances until +# they get refreshed. +f manifest var/svc/manifest/system/filesystem/auto-snapshot.xml 0644 root sys +f manifest var/svc/manifest/system/filesystem/zfs-auto-snapshot-monthly.xml 0644 root sys +f manifest var/svc/manifest/system/filesystem/zfs-auto-snapshot-frequent.xml 0644 root sys +f manifest var/svc/manifest/system/filesystem/zfs-auto-snapshot-daily.xml 0644 root sys +f manifest var/svc/manifest/system/filesystem/zfs-auto-snapshot-hourly.xml 0644 root sys +f manifest var/svc/manifest/system/filesystem/zfs-auto-snapshot-weekly.xml 0644 root sys diff --git a/src/samples/auto-snapshot-space-archive.xml b/src/samples/auto-snapshot-space-archive.xml index 0c7954b..5571426 100644 --- a/src/samples/auto-snapshot-space-archive.xml +++ b/src/samples/auto-snapshot-space-archive.xml @@ -12,18 +12,6 @@ - - - - diff --git a/src/samples/auto-snapshot-space-timf,backup.xml b/src/samples/auto-snapshot-space-timf,backup.xml index 144e9db..9212f83 100644 --- a/src/samples/auto-snapshot-space-timf,backup.xml +++ b/src/samples/auto-snapshot-space-timf,backup.xml @@ -14,18 +14,6 @@ - - - - diff --git a/src/samples/auto-snapshot-space-timf,daily.xml b/src/samples/auto-snapshot-space-timf,daily.xml deleted file mode 100644 index f916490..0000000 --- a/src/samples/auto-snapshot-space-timf,daily.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/samples/auto-snapshot-space-timf,frequent.xml b/src/samples/auto-snapshot-space-timf,frequent.xml deleted file mode 100644 index 7f96dfd..0000000 --- a/src/samples/auto-snapshot-space-timf,frequent.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/samples/auto-snapshot-space-timf,monthly.xml b/src/samples/auto-snapshot-space-timf,monthly.xml deleted file mode 100644 index 06f65e6..0000000 --- a/src/samples/auto-snapshot-space-timf,monthly.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/samples/auto-snapshot-tank-rootfs.xml b/src/samples/auto-snapshot-tank-rootfs.xml deleted file mode 100644 index 64572d3..0000000 --- a/src/samples/auto-snapshot-tank-rootfs.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot.xml b/src/var/svc/manifest/system/filesystem/auto-snapshot.xml old mode 100755 new mode 100644 similarity index 98% rename from src/var/svc/manifest/system/filesystem/zfs-auto-snapshot.xml rename to src/var/svc/manifest/system/filesystem/auto-snapshot.xml index 48194d0..8b3ef99 --- a/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot.xml +++ b/src/var/svc/manifest/system/filesystem/auto-snapshot.xml @@ -27,7 +27,7 @@ --> - + + + + + + + + + + + + + @@ -174,30 +194,6 @@ they being : sufficiently high numbers of instances, we can trip, say a 10 sec. timeout. - - - - - - - - - - - - - - - - diff --git a/src/var/svc/manifest/system/filesystem/auto-snapshot-daily.xml b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-daily.xml similarity index 69% rename from src/var/svc/manifest/system/filesystem/auto-snapshot-daily.xml rename to src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-daily.xml index fd3eaca..8226cb8 100644 --- a/src/var/svc/manifest/system/filesystem/auto-snapshot-daily.xml +++ b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-daily.xml @@ -17,30 +17,6 @@ snapshots into the past. - - - - - - - - - - - - - - - - diff --git a/src/var/svc/manifest/system/filesystem/auto-snapshot-frequent.xml b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-frequent.xml similarity index 66% rename from src/var/svc/manifest/system/filesystem/auto-snapshot-frequent.xml rename to src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-frequent.xml index 4139e53..737f04a 100644 --- a/src/var/svc/manifest/system/filesystem/auto-snapshot-frequent.xml +++ b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-frequent.xml @@ -17,30 +17,6 @@ com.sun:auto-snapshot:frequent=true every - - - - - - - - - - - - - - - - diff --git a/src/var/svc/manifest/system/filesystem/auto-snapshot-hourly.xml b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-hourly.xml similarity index 66% rename from src/var/svc/manifest/system/filesystem/auto-snapshot-hourly.xml rename to src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-hourly.xml index d0ffbd8..1e107d6 100644 --- a/src/var/svc/manifest/system/filesystem/auto-snapshot-hourly.xml +++ b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-hourly.xml @@ -17,30 +17,6 @@ and keeps 24 of these snapshots into the past. - - - - - - - - - - - - - - - - diff --git a/src/var/svc/manifest/system/filesystem/auto-snapshot-monthly.xml b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-monthly.xml similarity index 66% rename from src/var/svc/manifest/system/filesystem/auto-snapshot-monthly.xml rename to src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-monthly.xml index fb0f6c1..377dc3b 100644 --- a/src/var/svc/manifest/system/filesystem/auto-snapshot-monthly.xml +++ b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-monthly.xml @@ -17,30 +17,6 @@ and keeps 12 of these snapshots into the past. - - - - - - - - - - - - - - - - diff --git a/src/var/svc/manifest/system/filesystem/auto-snapshot-weekly.xml b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-weekly.xml similarity index 66% rename from src/var/svc/manifest/system/filesystem/auto-snapshot-weekly.xml rename to src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-weekly.xml index c6cddb0..14f1afd 100644 --- a/src/var/svc/manifest/system/filesystem/auto-snapshot-weekly.xml +++ b/src/var/svc/manifest/system/filesystem/zfs-auto-snapshot-weekly.xml @@ -17,30 +17,6 @@ and keeps 4 of these snapshots into the past. - - - - - - - - - - - - - - - -