From e73cecf0efaab7c0a61c9f7b5f667908f439a590 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Wed, 22 May 2019 08:36:52 +0200 Subject: [PATCH] backup2me.sh: fix arch rsync bug where --backup flag is needed to save archives --- backup2me.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backup2me.sh b/backup2me.sh index 6f324f0..30f9c5d 100755 --- a/backup2me.sh +++ b/backup2me.sh @@ -41,20 +41,19 @@ BACKUP_ARCHIVE=$7 BACKUP_ROOT_PATH="$(cat /etc/hostname)" BACKUP_BASE_PATH="$BACKUP_ROOT_PATH/$BACKUP_ROOT" BACKUP_CONTENTS_PATH="$BACKUP_BASE_PATH/_backup/" -BACKUP_ARCHIVE_PATH="$BACKUP_BASE_PATH/$BACKUP_ARCHIVE" -echo "Starting backup" +echo "Starting backup. Target: $BACKUP_BASE_PATH. Archive: $BACKUP_ARCHIVE" ### Before Script ### eval "$BEFORE_SCRIPT" ### Create local model of the remote's backup directory tree and send it ### mkdir -p "$BACKUP_CONTENTS_PATH" -rsync --timeout=30 -avzhP --relative "$BACKUP_CONTENTS_PATH" "$BACKUP_TARGET" +rsync --timeout=30 -avzhP --relative $BACKUP_CONTENTS_PATH $BACKUP_TARGET ### Backup home directory except some unwanted files ### -rsync --timeout=30 -avzhP --delete --inplace $BACKUP_EXCLUSIONS --backup-dir="../$BACKUP_ARCHIVE_PATH" "$BACKUP_DIRECTORY" "$BACKUP_TARGET/$BACKUP_CONTENTS_PATH" +rsync --timeout=30 -avzhP --delete --inplace $BACKUP_EXCLUSIONS --backup --backup-dir=../$BACKUP_ARCHIVE $BACKUP_DIRECTORY $BACKUP_TARGET/$BACKUP_CONTENTS_PATH ### Remove local model of the backup directory tree ### rm -R "$BACKUP_ROOT_PATH"