Skip to content

Commit b5ba63e

Browse files
authored
Improve restore function
1 parent e08e129 commit b5ba63e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backup_script.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ run_restore_mode() {
355355
if [[ -n "$dir_choice" ]]; then break;
356356
else echo "Invalid selection. Please try again."; fi
357357
done
358-
PS3="#? "
358+
PS3="#? "
359359
local full_remote_source=""
360360
local default_local_dest=""
361361
local item_for_display=""
@@ -543,10 +543,10 @@ run_recycle_bin_cleanup() {
543543
local remote_cleanup_path="${BOX_DIR%/}/${RECYCLE_BIN_DIR%/}"
544544
local list_command="ls -1 \"$remote_cleanup_path\""
545545
local all_folders
546-
all_folders=$(ssh "${SSH_OPTS_ARRAY[@]}" "${SSH_DIRECT_OPTS[@]}" "$BOX_ADDR" "$list_command" 2>> "${LOG_FILE:-/dev/null}") || {
546+
if ! all_folders=$(ssh "${SSH_OPTS_ARRAY[@]}" "${SSH_DIRECT_OPTS[@]}" "$BOX_ADDR" "$list_command" 2>> "${LOG_FILE:-/dev/null}"); then
547547
log_message "Recycle bin not found or unable to list contents. Nothing to clean."
548548
return 0
549-
}
549+
fi
550550
if [[ -z "$all_folders" ]]; then
551551
log_message "No daily folders in recycle bin to check."
552552
return 0

0 commit comments

Comments
 (0)