Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2012 17:50:24 +0100
From:      "Andrew Hotlab" <andrew.hotlab@hotmail.com>
To:        <peter@pean.org>
Cc:        ports@freebsd.org
Subject:   [patch] sysutils/zfs-periodic
Message-ID:  <DUB112-DS142E6485A78DFD47E330DBF6910@phx.gbl>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DUB112-DS142E6485A78DFD47E330DBF6910>