diff --git a/modules/filesystem/btrfs/btrbk.lib b/modules/filesystem/btrfs/btrbk.lib index f5cec92..39add74 100644 --- a/modules/filesystem/btrfs/btrbk.lib +++ b/modules/filesystem/btrfs/btrbk.lib @@ -72,9 +72,12 @@ echo making .latest symlinks in each destination for dest in $dests; do for snap in $latest; do # [[ -e $dest/${snap%%.*}.latest ]] && $dry_run_echo sudo rm $dest/${snap%%.*}.latest -local cmd="sudo ln -srfn $dest/$snap $dest/${snap%%.*}.latest" +# TODO only do latest links for locally mounted +if [[ -d $dest/$snap ]]; then +local cmd="sudo ln -srfn $dest/$snap $dest/${snap%%.*}.latest 2> /dev/null" echo $cmd -[[ ! $dry_run ]] && $cmd >&2 /dev/null +[[ ! $dry_run ]] && $cmd +fi done done diff --git a/modules/utility/copy.lib b/modules/utility/copy.lib index 517d6cc..b0d6db3 100644 --- a/modules/utility/copy.lib +++ b/modules/utility/copy.lib @@ -187,7 +187,7 @@ EOF args+=("${@:1}") fi - [[ $DHOST || $SHOST ]] && [[ $sshargs ]] && args+=( "$(remove_end_spaces "-e '$(ssh -l "${sshargs[*]}")'")") + [[ $DHOST || $SHOST ]] && args+=( "$(remove_end_spaces "-e '$(ssh -l "${sshargs[*]}")'")") # assemble options