Arrange for this domain's backup media to appear as this directory.
Simplest case is an external hard drive mounted onto
/srv/backup and allow all domains to appear as subdirs.
graham:/etc/rsnapshot/geddy.ausudo crontab -e
Adjust the backup schedule to requirements,
but maintain the temporal sequencing i.e. if a monthly runs, it must be
just before the weekly; if a weekly runs, it must be just before the daily.
Add client host to backed-up domain
The backup server must have keyed passwordless ssh
access by root to client hosts's root account.
Briefly, this usually means:
A copy of backup server's /root/.ssh/id_rsa.pub file must be
appended to the client hosts's /root/.ssh/authorized_keys
Parameter PermitRootLogin must be yes in the
client hosts's /etc/ssh/sshd_config file.
The example is based upon:
s0 – web server
s1 – mail server
graham:~cd /etc/rsnapshot/geddy.augraham:/etc/rsnapshot/geddy.ausudo vi rsnapshot.conf
This is deliberately not a full system backup,
only of our data.
The presumption is that everything else is re-installed or ephemeral.
Adjust the inclusions (and exclusions) as required.
In this example, the only subtree needing pruning for backup is
/var, and the exclusions are listed in the specified files.
The backup directive backs up binary copies of the files.
This is not always appropriate e.g. an SQL database.
The example shows backup_script calling a locally
implemented script (see further below) that creates a suitable dump
that is then configured to be placed alongside the
graham:/etc/rsnapshot/geddy.ausudo vi s0-var.exclgraham:/etc/rsnapshot/geddy.ausudo cp s0-var.excl s1-var.excl
In this case, s1's exclusions are identical to s0's.
graham:/etc/rsnapshot/geddy.ausudo vi /usr/local/sbin/pg_dumpallgraham:/etc/rsnapshot/geddy.ausudo chmod 554 /usr/local/sbin/pg_dumpallgraham:/etc/rsnapshot/geddy.ausudo ln -s /usr/local/sbin/pg_dumpall /usr/local/sbin/pg_dumpall-s1.geddy.au
Creates template postgres database dump script.
rsnapshotbackup_script takes no arguments so the
remote hostname is embedded in filename (after trailing hyphen).
Use template to create dumpall script for s1.geddy.au
by symlinking with appropriate filename.
This requires passwordless ssh access from root@localhost
to email@example.com (not shown here).
Obviously restoration is highly contextual.
The following path is highly instructive on backup image locations:
– the most recent daily backup of s0.geddy.au's