From c3f15c7834c42c5fc7575a8e611848441ee031e5 Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Tue, 26 Nov 2013 12:48:49 -0800 Subject: [PATCH] Simplify symlink creation. --- rsync_tmbackup.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh index 05c8fa8..5d3439e 100644 --- a/rsync_tmbackup.sh +++ b/rsync_tmbackup.sh @@ -280,10 +280,8 @@ while [ "1" ]; do # Add symlink to last successful backup # ----------------------------------------------------------------------------- - cd "$DEST_FOLDER" - rm -f -- "latest" - ln -s -- $(basename -- "$DEST") "latest" - cd - + rm -rf -- "$DEST_FOLDER/latest" + ln -vs -- "$NOW" "$DEST_FOLDER/latest" rm -- "$INPROGRESS_FILE" # TODO: grep for "^rsync error:.*$" in log