[NCLUG] I think

Stephen Warren swarren at wwwdotorg.org
Fri Feb 21 09:26:40 MST 2014


On 02/21/2014 07:48 AM, Kerry Miller wrote:
> Hello People,
> 
> I have written a fresh shell script:
...
> tar -cvzf /mnt/UserBackup/BK_KerrysStuff.tar.gz kerrym2/KerrysStuff
...
> tar -cvzf    /mnt/UserBackup/BK_MadiesStuff.tar.gz kerrym2/MadiesStuff

Just to derail the thread, why back up to tar files? This makes it
trickier to take a look at the contents of an old backup; you have to
separately extract the file(s), and then compare them, rather than
simply comparing them.

I'd suggest simply copying the whole tree with rsync, to a separate
(dated) backup tree. That way, you can easily do something like:

diff /mnt/UserBackup/20140221/home/kerrym2/some/file.txt
/home/kerrym2/some/file.txt

Of course, if(!) you're then copying the backups to some other machine
or off-site location, you do have to shift more files around than just a
few tar files. Still, rsync will easily do that for you, so you'd
actually end up reducing the number of tools you use for backup; rsync
for everything, vs. tar for the first step, then something else to copy
the tar files off-site.

As an extension to this technique, you can then hard-link your backup
trees together, so you can keep N backups in the space of 1 backup,
ignoring effects due to actual changes to the files. Of course, you need
some code to prune old backups so that the backup sizes don't grow in an
unbounded fashion if your files keep changing.

rsnapshot appears to be a tool to automate this. IIRC, I derived my
current backup system from, or was inspired by, something with a
slightly different name, but the idea is the same.

Of course, modern filesystems' snapshot capabilities can do this mostly
themselves, which probably ends up being simpler...

Finally: I assume you're:

a) Testing your restore process.

b) Are copying those tar files somewhere else (some other machine,
preferably in a significantly different physical location). Otherwise,
you're not creating backups, but rather creating snapshots.

These are the far more important aspects of backups than the way you
create them.



More information about the NCLUG mailing list