Allow user rsync options in backup script

This commit is contained in:
ItsDrike 2021-05-03 15:48:33 +02:00
parent 8f37b3e30e
commit 76e40cd44a
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD

View file

@ -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}"