RdiffbackupFirewire

From RdiffBackupWiki

Jump to: navigation, search

We use standard firewire cards, and Aluminium External firewire bays. The idea is that the backup contact rotates 2 or 3 external disks, so you get 2 or 3 day resolution on each disk, going back 30 days. Its probably not perfect, but seems to work for the 10 or so clients we have switched runnning on this system. Firewire drives crap all over tape for disaster recovery, combined with rdiff-backup its a great combo.


#!/bin/bash
# Backup script by David Kempe
# david@solutionsfirst.com.au
# Release under the GPL.
# Post your changes back here.
# you can get rescan-scsi-bus.sh from
# http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh
# you will need to --force a backup first.
#
# DISK is the removeable drive to be mounted
DISK=/dev/sda1

# Target is the target for mounting and backups
TARGET=/mnt/bigdisk
MOUNTPOINT=/mnt/bigdisk
SOURCE=/mnt/ntserver
MODPROBE=/sbin/modprobe
# use usb-storage for usb2 drives, sbp2 for firewire
MODULE=sbp2

if ! mount -l || grep "$DISK on $MOUNTPOINT"  ; then
	 $MODPROBE -r $MODULE
	 sleep 5
	 $MODPROBE $MODULE
	 echo "modprobing"
	 sleep 5
	 /usr/local/sbin/rescan-scsi-bus.sh
	 mount -t ext3 $DISK $MOUNTPOINT

	 if  ! mount -l || grep "$DISK on $MOUNTPOINT"; then
			 echo "Drive failed to mount!"
			 exit 0
	 fi

fi

/usr/bin/rdiff-backup -v6 --print-statistics  $SOURCE $TARGET
/usr/bin/rdiff-backup --remove-older-than 30D --force $TARGET

umount $MOUNTPOINT
sleep 5
$MODPROBE -r $MODULE
/usr/local/sbin/rescan-scsi-bus.sh

Back to ContribScripts

Personal tools