Merge pull request #248 from lnxadm/rsync_opts

Make the rsync options for cloud_backup and cloud_restore configurable via the rsync.conf
This commit is contained in:
fewtarius 2022-07-05 19:56:11 -04:00 committed by GitHub
commit 80e8e083be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -11,6 +11,7 @@ else
MOUNTPATH="/storage/cloud"
SYNCPATH="GAMES"
BACKUPPATH="/storage/roms"
RSYNCOPTSBACKUP="-raiv --prune-empty-dirs"
fi
echo -e "=> ${OS_NAME} CLOUD BACKUP UTILITY\n" >/dev/console
@ -19,7 +20,7 @@ echo "Mounting ${MOUNTPATH}" >/dev/console 2>&1
rclonectl mount ${MOUNTPATH} >/dev/console 2>&1
echo "Backing up data from ${BACKUPPATH} to ${MOUNTPATH}/${SYNCPATH}" >/dev/console 2>&1
rsync -raiv --include-from="${CONFIGPATH}/rsync-rules.conf" --prune-empty-dirs ${BACKUPPATH}/ ${MOUNTPATH}/${SYNCPATH}/ >/dev/console 2>&1
rsync ${RSYNCOPTSBACKUP} --include-from="${CONFIGPATH}/rsync-rules.conf" ${BACKUPPATH}/ ${MOUNTPATH}/${SYNCPATH}/ >/dev/console 2>&1
echo "Unmounting ${MOUNTPATH}" >/dev/console 2>&1
rclonectl unmount ${MOUNTPATH} >/dev/console 2>&1

View file

@ -11,6 +11,7 @@ else
MOUNTPATH="/storage/cloud"
SYNCPATH="GAMES"
BACKUPPATH="/storage/roms"
RSYNCOPTSRESTORE="-raiv"
fi
echo -e "=> ${OS_NAME} CLOUD RESTORE UTILITY\n" >/dev/console
@ -19,7 +20,7 @@ echo "Mounting ${MOUNTPATH}" >/dev/console 2>&1
rclonectl mount ${MOUNTPATH} >/dev/console 2>&1
echo "Restoring data from ${MOUNTPATH}/${SYNCPATH} to ${BACKUPPATH}" >/dev/console 2>&1
rsync -raiv --include-from="${CONFIGPATH}/rsync-rules.conf" ${MOUNTPATH}/${SYNCPATH}/ ${BACKUPPATH}/ >/dev/console 2>&1
rsync ${RSYNCOPTSRESTORE} --include-from="${CONFIGPATH}/rsync-rules.conf" ${MOUNTPATH}/${SYNCPATH}/ ${BACKUPPATH}/ >/dev/console 2>&1
echo "Unmounting ${MOUNTPATH}" >/dev/console 2>&1
rclonectl unmount ${MOUNTPATH} >/dev/console 2>&1

View file

@ -6,3 +6,9 @@ SYNCPATH="GAMES"
### This is the path we are backup up from.
BACKUPPATH="/storage/roms"
### This allows changes to the rsync options for cloud_backup
RSYNCOPTSBACKUP="-raiv --prune-empty-dirs"
### This allows changes to the rsync options for cloud_restore
RSYNCOPTSRESTORE="-raiv"