On Fri, Apr 01, 2011 at 10:04:53AM +0100, Phil Ashby wrote:
Chris G cl@isbd.net wrote:
Well here's my initial attempt at writing the incremental backup using rsync's --link-dest :- ...[weekly rotating backup script]
I got this going on my file server (not a NAS - it's a Debian box) using the following script, which can be executed at any interval that seems appropriate*, and retains a specified quantity of previous backups rather than a time limited number. I find that so little changes between backups that I can keep 100 of them on the same size backup media as the main storage (1TB, ~60% full).
This should work in ash almost as-is, but you may need to use dc for the maths (subtracting 1) instead of shell built-in capability: TGT=`echo $BKP 1 -pq|dc`
Notes:
- This keeps the backup device mounted read-only unless a backup is in progress, to avoid 'finger trouble' nuking important stuff.
- Uses the noatime option when mounted rw, to improve performance.
- Since this is a full file system backup, it excludes rather than includes folders.
- It doesn't try to back up if there is <10G of free space on the backup device (empirical determination, typically I see 10-20G of change at worst per backup).
- Error messages (and debug) to stderr as this is run by cron so will get emailed to root (me).
- Any issues are collected and stored in the backup folder.
Phil.
Thanks, much more sophisticated than mine but doing essentially the same sort of thing, I can use it to check that I have the right idea.