diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh index b7bf2c0..70789ca 100644 --- a/rsync_tmbackup.sh +++ b/rsync_tmbackup.sh @@ -129,11 +129,9 @@ if [ -f "$INPROGRESS_FILE" ]; then # - Last backup is moved to current backup folder so that it can be resumed. # - 2nd to last backup becomes last backup. fn_log_info "$INPROGRESS_FILE already exists - the previous backup failed or was interrupted. Backup will resume from there." - LINE_COUNT=$(fn_find_backups | wc -l) mv -- "$PREVIOUS_DEST" "$DEST" - if [ "$LINE_COUNT" -gt 1 ]; then - PREVIOUS_PREVIOUS_DEST=$(fn_find_backups | sed -n '2p') - PREVIOUS_DEST=$PREVIOUS_PREVIOUS_DEST + if [ "$(fn_find_backups | wc -l)" -gt 1 ]; then + PREVIOUS_DEST="$(fn_find_backups | sed -n '2p')" else PREVIOUS_DEST="" fi