I know this has been done efore but just thought I would share my (copied & modded) little script - tested tonight and working how I want - so am well psyched with the results!
Code: Select all
#======================
BUDATE=$(date +%Y%m%d)
BUINC=/mnt/backup/incremental/$BUDATE
/usr/local/bin/rsync -a -b --delete --exclude-from '/mnt/data/IT/scripts/exclude.txt' --backup-dir=$BUINC /mnt/data/ /mnt/backup/full
/usr/bin/bsdtar czf /mnt/backup/incremental/$BUDATE.tar.gz $BUINC
/bin/rm -rf /mnt/backup/incremental/$BUDATE
#======================
So, on first run an entire copy of the /mnt/data directory is made in /mnt/backup/full
The next night the diffs are created in /mnt/backup/incremental/DATE
The DATE folder is tarballed up and dropped into /mnt/backup/incremental
The DATE folder is then removed
Voila! Full backup plus daily incremental tar balls! I run this every week night at 10pm via the cron panel
exclude.txt just contains .recycle, .snap, .sujournal on seperate lines
To add - remove incremental tarballs after 14 days
#!/bin/sh
find /mnt/backup/incremental/* -atime +14 -exec rm -rf '{}' \;
taken from ;
http://blog.hani-ibrahim.de/en/automati ... e-bin.html
