[patch] sysutils/zfs-periodic
Andrew Hotlab
andrew.hotlab at hotmail.com
Mon Jan 2 17:09:53 UTC 2012
Sorry for my previous post, Hotmail's web interface is unusable to compose
plain-text messages... :(
First of all, it's a very nice and useful port: thank you for supporting it!
:)
I think I 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 the ZFS pool name from the dataset
path:
--- zfs-snapshot.orig 2011-06-17 00:07:15.000000000 +0200
+++ 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 like to see these changes in the next version of your port.
Sincerely.
Andrew
More information about the freebsd-ports
mailing list