>>102200520
I use a bad homebrew script to run incremental backups
it detects "parity-changes" (but does not detect which ver is good)
basically rsync with the --partial --backup --backup-dir flags
set -x
# Make sure none of the directory or file names listed below or included
# with * contain quotation-characters.
TIMESTAMP="$(date +'%Y%m%d_%H%M%S')"
BCK_DIR_MOD="000rsync_bck_${TIMESTAMP}"
BCK_DIR_DEL="000rsync_bck_${TIMESTAMP}_d"
OPTS_MOD="-arA --partial --backup --backup-dir=${BCK_DIR_MOD}"
OPTS_DEL="-arA --partial --backup --delete --backup-dir=${BCK_DIR_DEL}"
PROG="--info=progress2"
TARGET=/RSYNC_TARGET/main/
INCTWO="
--include=/bin
--include=/boot
--include=/etc
--include=/home
--include=/lib
--include=/lib64
--include=/lost+found
--include=/opt
--include=/root
--include=/sbin
--include=/usr
--include=/var
"
EXCTWO="
--exclude=/*
--exclude=/var/tmp/
--exclude=/var/cache/
--exclude=/home/*/.cache
--exclude=000rsync*
"
rsync ${OPTS_MOD} -i ${INCTWO} ${EXCTWO} / ${TARGET}
#rsync ${OPTS_DEL} -i ${INCTWO} ${EXCTWO} / ${TARGET}
>mount the backup drive at /RSYNC_TARGET/
>create a main/ directory on the backup drive
>I am BAD at bash so make sure to not have any shell-escape filenames that would be globbed in the includes
>run it once with the last OPTS_MOD line uncommented (backs up modified files)
>run it once with the last OPTS_DEL line uncommented (archives deleted files/directories)
copies the included directory tree
>skips files unchanged from last time
>copies backed up files modified from last time to a timestamped 000rsync-directory before backing up the new version
>moves backed up files deleted from last time to a timestamped 000rsync_d-directory
pros/cons:
>reasonably fast to run on subsequent backups
>scary and sloppy bash shortcuts that might break if you look at it the wrong way
>includes are tricky to get right
review carefully and use at your own discretion if you do ideally write your own