From 76e40cd44ad996d3bdd2abe9023a80aa4f1744de Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 3 May 2021 15:48:33 +0200 Subject: [PATCH] Allow user rsync options in backup script --- home/.local/bin/incremental-backup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/.local/bin/incremental-backup b/home/.local/bin/incremental-backup index ebe19a5..8b73bda 100755 --- a/home/.local/bin/incremental-backup +++ b/home/.local/bin/incremental-backup @@ -6,7 +6,7 @@ # This script will respect .rsync-filter files, which can be used # to define custom exclude rules for files/dirs in which it is present -if [ $# -ne 2 ]; then +if [ $# -ge 2 ]; then echo "Invalid amount of arguments passed!" echo "Arguments: [Source path] [Backup path]" echo " Source path: directory to be backed up, usually '/'" @@ -26,6 +26,6 @@ rsync -avHAXS \ --delete \ --filter='dir-merge /.rsync-filter' \ --link-dest "${LATEST_LINK}" \ - "${SOURCE_DIR}/" "${BACKUP_PATH}" + "${@:3}" "${SOURCE_DIR}/" "${BACKUP_PATH}" ln -sf "${BACKUP_PATH}" "${LATEST_LINK}"