From: Alan J. Pippin Date: Thu, 25 Sep 2008 15:26:00 +0000 (-0600) Subject: Fixed zfs-replicate bug when a filesystem is created on the backup drive, X-Git-Url: http://git.pippins.net/embedvideo/.git/images/%7Blink_hometeaching%7D?a=commitdiff_plain;h=fbf2b5b666f478f05b11bf4e4dac64151d55a9cb;p=zfs-ubuntu%2F.git Fixed zfs-replicate bug when a filesystem is created on the backup drive, and the snapshots for that filesystem are all deleted over time, and new ones are attempted to be sent to the backup drive. In this case, the script was trying to send incremental, but there were no snapshots left on the zfs filesystem. Now, if a filesystem exists on the backup drive but it has no snapshots, that filesystem is removed so a full stream will be sent of the first snapshot that is synced to the backup drive. --- diff --git a/zfs-replicate b/zfs-replicate index 9a6b82e..da3df12 100755 --- a/zfs-replicate +++ b/zfs-replicate @@ -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