From 057b8ad9dd02e82a807906dd9bb49b3b2091c934 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Wed, 20 Mar 2024 11:26:55 -0700 Subject: [PATCH] fix again suppress latest links. avoid remote targets fix created error where no sshargs does not add ssh command --- modules/filesystem/btrfs/btrbk.lib | 7 +++++-- modules/utility/copy.lib | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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