# HG changeset patch # User Franz Glasner # Date 1695314561 -7200 # Node ID 824e886183760cf52d19cb94d3adb0ab8affe7de # Parent 7056e5b7712d43a62415c1ee558ebbf4af8b856e The first version of "fzfs copy-tree" completed diff -r 7056e5b7712d -r 824e88618376 sbin/fzfs --- a/sbin/fzfs Thu Sep 21 12:03:09 2023 +0200 +++ b/sbin/fzfs Thu Sep 21 18:42:41 2023 +0200 @@ -260,7 +260,7 @@ local _ds_source_base _ds_source_snapshot _snapshot_suffix local _ds_tree _ds _ds_relname _ds_canmount - local _rflags + local _arg_canmount _arg_mp1 _arg_mp2 _opt_mountpoint="" _opt_mount_noauto="" @@ -299,6 +299,10 @@ echo "ERROR: source dataset does not exist: ${_ds_source}" 1>&2; return 1; fi + if zfs get -H name "${_ds_target}" >/dev/null 2>&1; then + echo "ERROR: target dataset already exists: ${_ds_target}" 1>&2; + return 1; + fi _ds_source_base="${_ds_source%@*}" _ds_source_snapshot="${_ds_source##*@}" @@ -311,9 +315,6 @@ _snapshot_suffix="" fi - echo $_ds_source_base - echo $_ds_source_snapshot $_snapshot_suffix - _ds_tree="" while IFS=$'\n' read -r _ds; do @@ -322,7 +323,6 @@ else _ds_tree="${_ds_tree}"$'\n'"${_ds}" fi - echo "X: $_ds" done <