projects
/
zfs-ubuntu
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Major changes from nexenta versions to support running under unbuntu.
[zfs-ubuntu/.git]
/
zfs-restore-all
diff --git
a/zfs-restore-all
b/zfs-restore-all
index 76c7bf8a0e1cf850a940bc07bad73212f0b1d5d0..3931190f753d21b821ceb92975187d1a3856d858 100755
(executable)
--- a/
zfs-restore-all
+++ b/
zfs-restore-all
@@
-10,7
+10,7
@@
config="${0%/*}/zfs-scripts.conf"
[ -e "${config}" ] && . ${config}
# Setup some default values
[ -e "${config}" ] && . ${config}
# Setup some default values
-logfile="$logdir/zfs-re
plicat
e-all.log"
+logfile="$logdir/zfs-re
stor
e-all.log"
# Setup our output
if [[ -z "$SCRIPT_UNDER_TEST" ]]; then
# Setup our output
if [[ -z "$SCRIPT_UNDER_TEST" ]]; then
@@
-22,7
+22,6
@@
cleanup_and_exit() {
}
trap cleanup_and_exit INT
}
trap cleanup_and_exit INT
-
# See if the user has a specific pool to restore in mind
restore_pool=$1
# See if the user has a specific pool to restore in mind
restore_pool=$1
@@
-34,13
+33,17
@@
for filesystem in $filesystems_to_replicate; do
dst_pool=${filesystem%%/*}
dst_fs=${filesystem#*/}
# Check to make sure the dst filesystem does not exist
dst_pool=${filesystem%%/*}
dst_fs=${filesystem#*/}
# Check to make sure the dst filesystem does not exist
- ssh $remote "$zfs list ${dst_pool}/${dst_fs}" > /dev/null 2>&1
+ if [[ $remote = "localhost" ]]; then
+ $ssh $remote $zfs list ${dst_pool}/${dst_fs} > /dev/null 2>&1
+ else
+ $zfs list ${dst_pool}/${dst_fs} > /dev/null 2>&1
+ fi
if [ $? != 0 ]; then
echo "$filesystem" | grep -q "$restore_pool"
if [ $? == 0 ]; then
# This filesystem matches our restore pool pattern
echo `date` Restoring $filesystem to $remote
if [ $? != 0 ]; then
echo "$filesystem" | grep -q "$restore_pool"
if [ $? == 0 ]; then
# This filesystem matches our restore pool pattern
echo `date` Restoring $filesystem to $remote
- zfs-restore $
local
_pool $filesystem $dst_pool $dst_fs $remote
+ zfs-restore $
backup
_pool $filesystem $dst_pool $dst_fs $remote
fi
else
echo "-I- Filesystem already exists on destination. Skipping: $filesystem"
fi
else
echo "-I- Filesystem already exists on destination. Skipping: $filesystem"