From 5b3f492851eb2f1335f3d2654cce156aab7b45a8 Mon Sep 17 00:00:00 2001 From: Rodrigo Campos Date: Thu, 18 Nov 2010 12:42:33 -0300 Subject: [PATCH 1/1] Create necessary files for new hosts When a new host is added to the backup, we need to create the top-level directory for its backup. Also, don't issue an error when the "current" symlink can't be removed (because it doesn't exist yet). Signed-off-by: Rodrigo Campos --- bacap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bacap b/bacap index 2257848..5b74c5e 100755 --- a/bacap +++ b/bacap @@ -103,6 +103,7 @@ do source "$host_path/bacaprc" 2>/dev/null host=`basename "$host_path"` host_backup_path="$BACKUP_PATH/$host" + mkdir -p $host_backup_path dst="$BACKUP_PATH/$host/$date" src=`cat "$host_path/paths"` [ "$host" != "$LOCALHOST" ] && @@ -134,7 +135,7 @@ do --link-dest="$current_dir" $src "$dst/" || ret=$(($ret+1)) plog "Moving current..." - $run rm $V "$current_link" || + $run rm -f $V "$current_link" || ret=$(($ret+1)) $run ln -s $V "$date" "$current_link" || ret=$(($ret+1)) -- 2.43.0