On Sun, Oct 05, 2014 at 09:32:18PM +0100, Jenny Hopkins wrote:
On 5 October 2014 18:12, Chris Green cl@isbd.net wrote:
I've been using rsnapshot to do backups for a year or two now but my backup NAS is just about full so I need to move to something with a bigger disk.
Rsnapshot uses rsync's --link-dest to create the hard-linked snapshots along with a lot of arcane perl (as far as I'm concerned Perl is always arcane!) and a big, complex configuration file.
So I'm considering a roll-your-own approach, it seems just too simple to be true. Does following pseudo-code look right:-
Run every day in the small hours IF (day_of_month = 1) IF (month = 1) # i.e. January 1st rename month12 to this_year ELSE remove month12 FI rename month11 to month 12 .... month1 to month2 rename day31 to month1 ELSE remove day31 FI move day30 to day31 .... day1 to day2 rsync with the --link-dest=DIR pointing to day2
I can create all the directories empty to start with so they're all there to be moved even though with nothing in them.
This will (hopefully!) create daily backups for 31 days, monthly backups for 12 months and yearly backups for ever (!?).
--
Have a look at Dirvish, which uses rsync and has built-in preferences. No need to roll your own. Also a good support mailing list.
Dirvish seems rather like rsnapshot, horribly complicated! :-) It also has a number of deficiencies from my point of view:-
It doesn't do 'graded' older backups as far as I can see, it just does daily snapshots for a number of days and then deletes everything older than x days. I want monthly and yearly snapshots as well so I can find stuff from last year or even further back.
As far as I understand it Dirvish does 'pull' backups so all the work is on the backup machine, this doesn't work so well on a low-powered (in processor terms) NAS.
Being a 'pull' backup introduces all sorts of security problems, my backup NAS can only be accessed by ssh and except for physical removal the backed up files are accessible only to that root login. (the above psuedo-code doesn't manage this quite so well, I'm working on it!).
The separate dirvish-expire and dirvish-runall seems a weakness to me (minor, and could be overcome).