X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=zfs-replicate;h=da3df12614ab76e8090bdeb0a468675f09930eeb;hb=fbf2b5b666f478f05b11bf4e4dac64151d55a9cb;hp=f878518c4d84f68d7b206448ef9efb415e3b00b5;hpb=db345818e94a6ed712b6be68c3204e60c6972773;p=zfs-ubuntu%2F.git diff --git a/zfs-replicate b/zfs-replicate index f878518..da3df12 100755 --- a/zfs-replicate +++ b/zfs-replicate @@ -10,7 +10,7 @@ # In test mode (test=1) commands are echoed, not executed test=0 -[ $test == 0 ] && exec >> /var/log/zfs-replicate.log 2>&1 +[ $test == 0 ] && exec >> /var/log/zfs/zfs-replicate.log 2>&1 # Usage: zfs-backup [filesystem] [destination_pool] # This script has a limitation with children under a given filesystem. @@ -49,7 +49,12 @@ if ! zpool list -H "$dstpool" >/dev/null 2>&1; then fi if ! zfs list -rH -t snapshot "$dstfs" 2>&1 | grep "$dstfs@" > /dev/null 2>&1; then - echo >&2 "-W- No snapshots detected on the destination drive for this filesystem" + echo >&2 "-W- No snapshots detected on the destination drive for this filesystem: $dstfs" + if zfs list -t filesystem | grep "$dstfs"; then + echo >&2 "-I- Found zfs filesystem $dstfs on the destination pool $dstpool without any snapshots" + echo >&2 "-I- Removing the zfs filesystem: $dstfs" + zfs destroy "$dstfs" + fi nodstsnaps=1 fi