directories to exclude for backups
dany_list at natzo.com
dany_list at natzo.com
Thu Feb 26 20:07:51 PST 2004
Im not a sysadmin but I wanted to share the configuration I use at home for my
file server running on a small Epia mini-ITX fanless motherboard.
Basically the box only has 2x 120GB hard drives. Then its combination of
dump/rsync/rdiff-backup. I wanted to be able to swap drives if something goes
wrong with one drive or if do something wrong with a system update. I didnt
want to go the RAID/vinium way as I also wanted incremental snapshots. Beside
those three tools I also use Unison to synchronize important files between
laptop-dekstop-fileserver (windows/linux client).
The three tools mentioned above help me to solve the following problems :
- dump : to make a hardcopy of the / directory and all those hardlinks (also
used for /var and /tmp even if they may not need to be backed up)
- rsync : to mirror /usr directory (damn fast)
- rdiff-backup : I use that for my personal data because as a stupid user I do
make mistakes so rdiff-backup keeps track of file histories for me. Its a kind
of incremental rsync where you can recover any file from any date.
Basically the two drives share the same organization (ad0 for the first one, ad2
for the second one)
ad0s1a / 128M
ad0s1b swap 512M
ad0s1d /var 128M
ad0s1e /tmp 200M
ad0s1f /usr 3200MB
ad0s2d /data 110GB
Then I use the following commands from a script started by a daily cronjob (its
not a real script yet as it doesnt verify/confirm anything, just a bunch of
# root backup
newfs /dev/ad2s1a  I had trouble overwriting the same
slice with dump so I erase it before
might not be the best choice
dump -0 -f -L - /dev/ad0s1a | (cd /backup/os/root ; restore -r -v -f -)
# /tmp backup
dump -0 -f -L - /dev/ad0s1e | (cd /backup/os/tmp ; restore -r -v -f -)
# /var backup
dump -0 -f -L - /dev/ad0s1d | (cd /backup/os/var ; restore -r -v -f -)
# /usr backup
rsync -a --delete /usr/ /backup/os/usr
# Typical incremental backup from drive 1 to drive 2
rdiff-backup /data/current/mp3 /backup/data/backup/mp3
# for this one I first do the incremental backup on the same drive and then
rsync over the second drive (so I can have the incremental backup on both drives)
rdiff-backup /data/current/alpha_current /data/current/alpha_backup
rsync -a delete /data/current/alpha_backup/ /backup/data/backup/alpha_backup
I understand that it's probably not the best and most official way to do work
with backups but as a newbie to FreeBSD Im quite happy with this configuration.
Quoting "Benjamin P. Keating" <bkeating at teov.org>:
> My Plan is to make a gzipped tarball of the entire machine, excluding
> directories that are not necessary. If however, there is a more sound
> solution then tarballing a machine for a backup, Im all ears. I know
> rsync is a possibility, but i'd like to have just a solid, non-active
> archive copy of machines.
> EXCLUDE DIRECTORIES
> What else would be safe to exclude?
> This message has been scanned for viruses and
> dangerous content, and is believed to be clean.
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions