Added new option to expect empty remote lists when backing up to a new disk
[zfs-ubuntu/.git] / zfs-replicate
index 7f205e2ea87698e02d1acb0d9ecc330b0e5ac889..a5a3ad9653787db0fcd5798e5fccddc60c7082fc 100755 (executable)
@@ -170,7 +170,7 @@ $zfs list -H -t snapshot |
     grep ^${backup_pool}/${remote_fs}@ |
     grep -v ^${backup_pool}/${current_backup_marker} | 
     awk "{gsub(/^$backup_pool./,\"\",\$1); print\$1}" > $local_list
-if [ $? != 0 ]; then
+if [[ $? != 0 ]] && [[ $expect_empty_remote_list == 0 ]]; then
   fatal_and_exit "-E- local $zfs list on $hostname command failed" $mailto
 fi