Added logging to zfs-scrub
authorAlan J. Pippin <ajp@pippins.net>
Mon, 12 Jan 2009 07:44:01 +0000 (00:44 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Mon, 12 Jan 2009 07:44:01 +0000 (00:44 -0700)
Changed zfs-replicate pool name to backups
Fixed snapname bug in zfs-autosnap

zfs-autosnap
zfs-replicate
zfs-scrub

index 2493e0b32415f78290320f96d7c1de630b53b9c0..cfe80aaab8adb067e0cfa1615186f716ce96f548 100755 (executable)
@@ -130,8 +130,8 @@ for snapshot in $snapshots; do
       case $((snapminutes2 % window)) in
         0) ;;
         *)
-          snapname=$(echo "$snapshot" |
-                       sed 's,/\(.*\)/.zfs/snapshot/\(.*\),\1@\2,')
+          snapname=${filesystem}$(echo "$snapshot" |
+                                  sed 's,/\(.*\)/.zfs/snapshot/\(.*\),@\2,')
           destroy "$snapname"
         ;;
       esac
@@ -140,8 +140,8 @@ for snapshot in $snapshots; do
     window=$((window*2))
   done
   if [ $maxagedays -gt 0 ] && [ $age -gt $((maxagedays * 24 * 60)) ]; then
-    snapname=$(echo "$snapshot" |
-                     sed 's,/\(.*\)/.zfs/snapshot/\(.*\),\1@\2,')
+    snapname=${filesystem}$(echo "$snapshot" |
+                            sed 's,/\(.*\)/.zfs/snapshot/\(.*\),@\2,')
     destroy "$snapname"
   fi
 done
index 3e8813d32c723c8752cb1c63aed8c7399dd50e4c..7f93696da6b12e29119e9a56236913ff02b4bd26 100755 (executable)
@@ -7,7 +7,7 @@ remote=$1
 remote_fs=$2
 
 # change to match the name of the local backup pool
-local_pool=backpool
+local_pool=backups
 
 # The ssh connection doesn't find zfs without this.
 zfs=/usr/sbin/zfs
index 6488beb1aba222c80c5d29043e4700fd0ff8d6e5..dffe0803941b7911a0aff4dbe7861914c5279b13 100755 (executable)
--- a/zfs-scrub
+++ b/zfs-scrub
@@ -6,6 +6,8 @@
 #              running at any given time. This serializes the zfs 
 #              scrub process for any pool.
 
+exec >> /var/log/zfs/zfs-scrub.log 2>&1
+
 PATH=/usr/sbin:/sbin:/etc/bin:$PATH
 
 pools="$*"