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 <rodrigo@sdfg.com.ar>
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" ] &&
--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))