Mailinglist Archive: opensuse (3337 mails)

< Previous Next >
Re: [opensuse] backup question to y'all
  • From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@xxxxxxx>
  • Date: Tue, 11 Apr 2006 00:27:31 +0200
  • Message-id: <443ADBD3.6040304@xxxxxxx>
For full backups with incremental space usage, try the following
script. It will create backup directories with the current date,
and unchanged files will be hardlinked to the old version.
Caution: The last line (the rsync command) may be linewrapped by
my mailer.

#!/bin/bash
# incremental full backups with rsync
# (c) Carl-Daniel Hailfinger
accessmode="-e ssh"
remotehost="p35:"
remotepath="/home/carldani"
# for local backups, change accessmode and remotehost to empty strings
unset LS_OPTIONS
rsync -av --delete --link-dest=/backups/`ls /backups/|sort|tail -1` $accessmode $remotehost$remotepath /backups/`date +%F`

This script has been in use for my personal backups for the last
3 years (maybe more). Since my $HOME is approx. 1 GB with 250 MB
changing files (mail etc.), I can burn a group of 14 backups to
one DVD without any special tools (as long as you don't use k3b,
it will barf or corrupt your backups) and even have them appear
as full backups on CD with incremental space usage.

The most important point of this backup strategy is that you can
rm -rf older backups including the first one and still have all
files available.


Regards,
Carl-Daniel
--
http://www.hailfinger.org/

< Previous Next >
References