[patch] sysutils/zfs-periodic

Andrew Hotlab andrew.hotlab at hotmail.com
Mon Jan 2 16:52:34 UTC 2012


First of all, it's a very nice and useful port: thank you for supporting it! :) I think to have found an error in the file "etc/periodic/weekly/000.zfs-snapshot". Here is the patch: --- 000.zfs-snapshot.orig 2012-01-02 17:24:53.000000000 +0100 +++ 000.zfs-snapshot 2012-01-02 17:23:48.000000000 +0100 @@ -18,7 +18,7 @@ keep=7 fi -case "$daily_zfs_snapshot_enable" in +case "$weekly_zfs_snapshot_enable" in [Yy][Ee][Ss]) . /usr/local/bin/zfs-snapshot do_snapshots "$pools" $keep 'weekly' If we want to create snapshots at dataset level, the main scripts always returns an error, because it doesn't find the pool name to exccute the scrub chek on. The following patch extract theZFS pool name from the dataset path: --- zfs-snapshot.orig 2011-06-17 00:07:15.000000000 +0200 +++ /usr/local/bin/zfs-snapshot 2011-06-20 09:43:39.000000000 +0200 @@ -3,9 +3,9 @@ # checks to see if there's a scrub in progress scrub_in_progress() { - pool=$1 + rootpool=`echo $pool | sed 's/\([^\/]*\)\/.*/\1/'` - if zpool status $pool | grep "scrub in progress"> /dev/null; then + if zpool status $rootpool | grep "scrub in progress"> /dev/null; then return 0 else return 1 I'd glad to see this patch committed to the Ports' repository. Sincerely. Andrew 		 	   		  


More information about the freebsd-ports mailing list