[TriLUG] Advice sought on Laptop backup
Alan Porter
porter at trilug.org
Fri Sep 23 14:16:29 EDT 2005
Hi Rick (and others),
I have a little backup script that has evolved over the last
year which does exactly what you're talking about. It detects
where it is (at work, at home, etc) and then backs up whatever
files are appropriate to whatever server is appropriate.
I call it "ap_backup".
To give you an idea of what it does, here is my config file.
------------------------------------------------------------
# /etc/ap_backup.conf
[JOB=nightly]
PREBACKUP_COMMAND=/root/backup/pre-backup.sh
RSYNC=/home/alan,/root,/etc
[DOMAIN=home.dyndns.org]
REMOTE_HOST=homeserver
REMOTE_USER=backup-laptop
REMOTE_TAR_PATH=current
REMOTE_RSYNC_PATH=current
[DOMAIN=work.com]
REMOTE_HOST=workserver
REMOTE_USER=alan
REMOTE_TAR_PATH=laptop
REMOTE_RSYNC_PATH=laptop
[JOB=overthenetwork]
PREBACKUP_COMMAND=/root/backup/pre-backup.sh
RSYNC=/home/alan,/root,/etc
REMOTE_HOST=home.dyndns.org
REMOTE_USER=backup-laptop
REMOTE_TAR_PATH=current
REMOTE_RSYNC_PATH=current
RSYNC_OPTIONS=--exclude=/tmp --delete-excluded
------------------------------------------------------------
I have a cron job that runs "ap_backup job=nightly".
It uses the values from the [JOB=nightly] section of the
config file. It looks at the current domain by pinging
(hostname)+"."+(resolv.conf domain). It uses the
settings from whichever DOMAIN=xxxx section that
matches.
I can also call "ap_backup job=overthenetwork" to back
the machine up from work to home, using the relatively
slow internet connection.
The script --> http://home.alanporter.com/ap_backup
Config file --> http://home.alanporter.com/ap_backup.conf
The script used to just to TAR backups (backing up
locally, remotely, or both). But I later changed it
to support RSYNC as well. Each method has advantages.
On one machine, I do nightly RSYNC backups and a
weekly TAR backup.
My little script makes it pretty easy, and there are a
few options that you can tweak. Let me know if you're
interested in using it. I'd be happy to help set it up.
Alan
.
More information about the TriLUG
mailing list