MythicX: LhaysomTek Industries
Home || Links || All Articles || Feedback

Recent Articles:

2006/07/13
• On how to do a remote incremental backup with rsync
2006/05/25 (upd. 2007/06/21)
• A rant (and some more info) on the Logitech Harmony 885 remote control
2006/02/11
• A starting point for a busybox based initrd
2006/01/24
• Easy KnoppixOid on a USB HDD / USB Stick
2006/01/16
• Debian, Ubuntu and, *sigh* OpenSSL
2006/01/02
• New Design and Structure
2005/07/16
• Automating my Yahoo! mail
(Last changed: 2006/07/13 )

On how to do a remote incremental backup with rsync

Hello

This is on how to do remote incremental backups. Its rather a recipe than a turnkey solution.

You need first to install a few tools, then you mail put this script (after heavy editing of course) into your /etc/cron.daily.

Prerequisites are a generated and propery deployed ssh-keypair and a

#!/bin/bash

{

cd /where_the_backup_and_reference_directories are

pushd BACKUP

        for a in locations you want to remotely backup incrementally
        do
                rsync -Ra $a .
        done
popd

TIMESTR=`date '+%s'`

DFILE=rib.$TIMESTR
TFILE=t_rib.$TIMESTR.7z
CFILE=c_rib.$TIMESTR

echo Creating $DFILE

rsync --write-batch=$DFILE -a BACKUP/ REFERENCE

7za a $TFILE rib.*
echo yoursecretpassword|gpg -c --passphrase-fd 0 --batch $TFILE

mv $TFILE.gpg $CFILE

#and do not forget to generate and deploy a suitable ssh keypair
scp $CFILE thatbackupaccount@your.backup.host:

rm rib.*
rm $TFILE
rm $CFILE


} >>/root/rbackup.log 2>&1