On Sat, Sep 13, 2003 at 12:00:11AM -0700, Mark Terribile wrote: > I'm looking to improve and automate my primitive > backups and I'm considering dump(8)/restore(8). But > before I go this route, I'd like to be sure I can > control their behavior. Unfortunately, the man pages > don't seem to completely describe the interaction > between the numerical dump flag in /etc/fstab and > the dump level. Can anyone elucidate?
Dump levels are a flexible way of implementing incremental backups. A level 0 dump will always back up everything[*]. Then a level 1 dump backs up all of the files that have been modified since the last level 0 dump, and a level 2 dump would backup every file that had been modified since the previous lower level (level 1 or level 0) dump, and so on, all the way down to a level 9 dump. Let's look at some common dump schemes. I'll base these around a weekly cycle, using a separate tape for each day of the week: generally what you'ld do is have several sets of these weekly tapes that you cycle through, so you aren't completely lost if one of those sets of tapes should be found to be substandard. People with more money (or backup media) than is good for them can just run a full backup every day: Sun Mon Tue Wed Thu Fri Sat 0 0 0 0 0 0 0 This maximizes the amount of data to back up each day, but also minimizes the amount of effort required to restore the system to the state at any particular date and it gives you minimum exposure should one of your tapes fail. The alternate extreme is: 1 2 3 4 5 6 7 So that except for Sunday, each day all you do is backup what changed since the previous day. It's assumed that your level 0 dump corresponds to the state of the system immediately after installation, and you may or may not actually perform a level 0 dump at that time. Prudence dictates that you should certainly run an occasional level 0 dump to help keep the size of your level 1 tape sets down and just on general principles. This is parsimonious with the tapes, but if you need to restore the system to the state on Saturday, you need *all* of your weeks tapes. And if the Monday tape breaks, then the following Tuesday to Saturdays' tapes are pretty much useless. Probably the most popular scheme is: 1 3 3 3 3 3 3 So each day you back up everything that changed since the previous level 1 backup. (Or you could do a level 0 instead ot the level 1 each week for extra security). That means that the Friday or Saturday tapes get a lot more use than the Monday tape. However all you need to restore the system is the level 1 and the appropriate level 3 tape. > In the same vein, does anyone know the > `modified tower of Hanoi' algorithm the man page > recommends? If you don't know what "Towers of Hanoi" is, fire up your nearest copy of emacs and run: M-x hanoi or M-x hanoi-unix although that second one takes quite some time to run to completion. The 'modified Towers of Hanoi" backup sequence is based on that game. This is an optimised sequence that achieves a balance between the different extremes shown above. A weekly system would look like: 1 3 2 5 4 7 6 although the man page shows how to extend that for a few extra days. This results in approximately the same amount of data being saved on each daily tape, but doesn't require that all tapes are needed to do the Friday backup and should one of the daily tapes fail (other than a level 1 tape), you can still restore to the state only one day away. Thus: Tapes needed Sun: 1 Mon: 1, 3 Tue: 1, 2 Wed: 1, 3, 5 Thu: 1, 2, 4 Fri: 1, 3, 5, 7 Sat: 1, 2, 4, 6 By the way, although I've shown all of these cycles based on a week starting on Sunday, I can tell you from practical experience that the full level one backup is most likely to need attention, so it's often a good idea to shift the cycle round so that the big weekly backup happens on a week day. Cheers, Matthew [*] Except when you use the '-h 0' flags to dump(8), which tells dump(8) to honour the 'nodump' file flag even at level 0. By default the 'nodump' flag is only honoured at level 1 or higher. -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK
Description: PGP signature