X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=zfs-restore-all;h=dbe09a1d57c9a761afb166d6659ec901ac90cb68;hb=refs%2Fheads%2Fmaster;hp=3931190f753d21b821ceb92975187d1a3856d858;hpb=7f9a942edf3de137e1f244b5a680d5ec993171cc;p=zfs-ubuntu%2F.git diff --git a/zfs-restore-all b/zfs-restore-all index 3931190..dbe09a1 100755 --- a/zfs-restore-all +++ b/zfs-restore-all @@ -30,6 +30,12 @@ echo `date` ZFS restore started # For each filesystem we are supposed to restore, do it for filesystem in $filesystems_to_replicate; do + if [[ $filesystem =~ ':' ]]; then + src_pool=${filesystem%%:*} + filesystem=${filesystem#*:} # remove src_pool from string + else + src_pool=${backup_pool%% *} # use the first backup pool if none specified + fi dst_pool=${filesystem%%/*} dst_fs=${filesystem#*/} # Check to make sure the dst filesystem does not exist @@ -43,7 +49,7 @@ for filesystem in $filesystems_to_replicate; do if [ $? == 0 ]; then # This filesystem matches our restore pool pattern echo `date` Restoring $filesystem to $remote - zfs-restore $backup_pool $filesystem $dst_pool $dst_fs $remote + zfs-restore $src_pool $filesystem $dst_pool $dst_fs $remote fi else echo "-I- Filesystem already exists on destination. Skipping: $filesystem"