projects
/
zfs-ubuntu
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test commit
[zfs-ubuntu/.git]
/
zfs-replicate-wrapper
diff --git
a/zfs-replicate-wrapper
b/zfs-replicate-wrapper
index b52e64e05e3ffbb7c8fb77a88af8756013ed61e3..1f21c5ed3ec8bd5649b0510ae8c46907c970603c 100755
(executable)
--- a/
zfs-replicate-wrapper
+++ b/
zfs-replicate-wrapper
@@
-21,11
+21,12
@@
cleanup() {
rm -rf "$lockdir"
if [ $released_lock_date == 0 ]; then
zpool export $destpool
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
echo `date` ZFS admin lock released >> $logfile
fi
+ exit
}
}
-trap cleanup
EXI
T
+trap cleanup
IN
T
# Auto snapshot every zfs filesystem on the system specified below
echo "$date Polling for ZFS admin lock" >> $logfile
# 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
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
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
# 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
# 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
# Parse the log file and extract our backup stats
$logfile_parser "$logfile" "$date" >> $logfile
+# clean things up and exit
+cleanup
+