Updated paths
[zfs-ubuntu/.git] / zfs-replicate-wrapper
index b52e64e05e3ffbb7c8fb77a88af8756013ed61e3..1f21c5ed3ec8bd5649b0510ae8c46907c970603c 100755 (executable)
@@ -21,11 +21,12 @@ cleanup() {
   rm -rf "$lockdir"
   if [ $released_lock_date == 0 ]; then 
     zpool export $destpool
-    /usr/local/etc/bin/usb-drive-power off
+    /usr/local/etc/bin/ext-drive-power off
     echo `date` ZFS admin lock released >> $logfile
   fi
+  exit
 }
-trap cleanup EXIT
+trap cleanup INT
 
 # Auto snapshot every zfs filesystem on the system specified below
 echo "$date Polling for ZFS admin lock" >> $logfile
@@ -53,7 +54,7 @@ date=`date`;
 echo "$date ZFS admin lock obtained" >> $logfile
 
 # Poweron the destpool and import it
-/usr/local/etc/bin/usb-drive-power on >> $logfile
+/usr/local/etc/bin/ext-drive-power on >> $logfile
 zpool import $destpool
 
 # List the filesystems to replicate
@@ -72,7 +73,7 @@ $replicate tank/backup $destpool
 
 # Export the destpool and power it down
 zpool export $destpool
-/usr/local/etc/bin/usb-drive-power off >> $logfile
+/usr/local/etc/bin/ext-drive-power off >> $logfile
 
 # Release our lock
 released_lock_date=1
@@ -81,3 +82,6 @@ echo `date` ZFS admin lock released >> $logfile
 # Parse the log file and extract our backup stats
 $logfile_parser "$logfile" "$date" >> $logfile
 
+# clean things up and exit
+cleanup
+