[NCLUG] Server-to-Server backups

Alan Silverstein ajs at frii.com
Tue Jun 27 13:15:59 MDT 2006


What you want to do can also be done by what I call a "rolling backup".

Over 20 years ago I administered the site hub UNIX system for HP-FC, and
the main disk drive started making noises...  If it crashed, I didn't
want to lose any more current data than I could, even back to last
night's tape backup...  So I wrote shell scripts to do rolling backups.
I have since improved them to make them more robust and portable.
However, others have already posted about modern software that is even
more efficient, block-based not just file-based, etc, so the rest of
this is just FYI.

Anyway, what a rolling backup does (by my definition) is to check a
specified set of subtrees for files with mtimes newer than the last
successful completion (note well the fail-safe here), and copy those
files to a shadow tree (same layout) on another system, or at least on
another spindle.  I think I used find -mtime and cpio for this, along
with NFS in some cases; nothing fancy.  Then, less often, another cron
daemon checks the shadow tree for files older than however many days and
deletes them, and then removes any empty directories.  The cleanup
script emails a report on remaining file counts and sizes.

I rigged the backups to take place hourly, on the hour, and the cleanups
to take place nightly.

This saved me many times if I broke or removed a file, mostly in my home
directory.  A quick glance at the clock told me that in almost all cases
I could just copy back the rolling backup file and be restored to a
known point.  (I set shell parameters to conveniently do this, for
example:  "cp -f $b/$PWD/foo .")  As long as the file in question was
last touched within the cleanup period and before the last top-of-hour,
anyway.  So I seldom had to resort to REAL nightly backups, which were
on tape at that time.

Note that a rolling backup is not a full clone or mirror, it's a
different animal.

Cheers,
Alan Silverstein



More information about the NCLUG mailing list