[SATLUG] How do you take a dump?
Daniel J. Givens
daniel at rugmonster.org
Thu Feb 8 06:31:55 CST 2007
twistedpickles wrote:
> Yes I'm talking about backups. In the past all my backups have been
> manually to CD or DVD. Now I'm interested in something that can be
> automated and incrementally backed up to an external HD.
>
> I've been reading and reading. The more traditional utilities appear
> to be dump and tar. Recently I have stumbled across rsync.
>
> How do you backup info to HD's?
My at-home strategy:
I have a file server that has an external hard drive connected to it. I share
the external hd via NFS and mount that share on my other systems.
I use a combination of dar and bzSarab to do incremental weekly rotating system
backups of directories like /etc, /boot, /opt, /var, /usr/local. Basically, I
back up the stuff that keeps the stuff I bring to the system that couldn't be
retrieved from packages again.
I use mysqlhotcopy and the hot-backup.py to backup my MySQL databases and SVN
repositories to a directory which is archived by dar. If I could change one
thing, it would be to use LVM filesystem snapshots and get rid of mysqlhotcopy
and hot-backup.py completely. Unfortunately, when I setup my home server, I
didn't leave any free space and used XFS for my fs type, so I can't shrink the
logical volumes.
My homedirs are backed up via rsync. I run rsync twice in my script. First, it
scans for files that should be deleted from the archive and emails me the
results, then on the second pass copies the new and modified files. I don't want
rsync deleting files just in case I accidentally deleted something. I started
doing backups because I did an rm -rf /dir when the command should have been rm
-rf /dir/subdir. Every once and a while, I'll run my backup-del script which
runs rsync with the delete flag.
The reason I use rsync for the homedirs is for sake of size. I don't so much
care about archives of the homedirs, but I suppose I could do a monthly DVD-RW
rotating archive if I wanted to. I mainly just want to be able to copy crap back
over quickly with my homedir stuff. The reason I do the incremental backup
archives with dar for the system is in case I do something and don't catch it
for a few days. That's much more likely to happen outside of my homedir.
Back to the system, since I run a Debian based distro, I dump out a formatted
package list to a file on the backup hd so that I can do a little dpkg import
magic and get all of the same packages re-installed.
Between using the package list to reinstall the packages, restoring the dar
archives and copying the homedirs back over, I can have my system back up in
nearly identical form in less than two hours. If you need faster recovery, then
you could look at full system backups with dar. Then it would just be a matter
of boot from a livecd and restoring the files across the network/from tape/etc.
If you would like to see my scripts, I can put them up on my server to share.
DAR
http://dar.linux.free.fr/
bzSarab
http://trac.bzzzrk.org/bzzzrk/bzsarab <--- Download link on page seem broken.
I have a copy of the latest lurking on one my systems. I can dig it up if anyone
wants it.
~Daniel
More information about the SATLUG
mailing list