On Sunday 02 November 2003 08:05 pm, Rick [Kitty5] wrote:
> What do people do / recommend for backing up?


I do rsync backups as well but to a normally unmounted spun down drive 
on a second box. The script below runs at 12:01 AM daily. My script 
is still a bit crude but it evolves as I learn and get around to 
working on it

#======================================================================
#! /bin/bash
# /usr/local/bin/my-rsync
#######################
# Backup Script
#######################

[EMAIL PROTECTED]:/mnt/backup
EXCLUDE=/usr/local/bin/rsync-exclude
#MAILTO="/bin/mail root"
echo "   Mounting boot partition..."
sudo mount /boot -o ro
echo
echo "   Mounting backup disk..."
ssh -T [EMAIL PROTECTED] <<END
sleep 5
mount /dev/hdb1 /mnt/backup
END

sleep 4
echo
echo "   Performing backup..."
echo
rsync --rsh="ssh" --delete -av --exclude-from=$EXCLUDE / \
        $BACKUP_TO/rsync/ | mail -s "backup daily output" root

echo
echo "   Backup complete Unmounting boot and backup partitions..."

/bin/umount -l /boot
ssh -T [EMAIL PROTECTED] <<END
sleep 5
umount /mnt/backup

echo
echo "   Spinning down backup disk..."
/sbin/hdparm -y /dev/hdb                # spin down disk
END
#======================================================================


/usr/local/bin/rsync-exclude is a simple text file containing files 
and directories that I don't want to include in the backup. There are 
many additions I should make to this file, but I haven't spent much 
time refining it lately. The backup is currently just over 6 Gigs and 
it normally runs for about 10 to 15 minutes. The first run was 
several hours. The nightly run deletes any files I deleted that day 
and then writes any new or altered files not specificly excluded,

# /usr/local/bin/rsync-exclude:
- /tmp/
- /var/lib/init.d/
- /mnt/flash                               #in case I forget to umount removable 
storage 
- /mnt/smartcard                           #media, cd's etc.
- /mnt/tmp
- /mnt/cdrom/
- /mnt/floppy/
- /proc/
- /usr/portage/distfiles/
- /root/.ccache/
- /home/ernie/Shared_Music    #mp3's that can be seen by p2p client
- home/ernie/.kde3.1/share/apps/RecentDocuments/
- /home/ernie/tmp                      #Partially d'loaded mp3's
- /home/ernie/mnt                      #Samba mounts
- /var/tmp/portage


-- 
Regards, Ernie
100% Microsoft and Intel free


--
[EMAIL PROTECTED] mailing list

Reply via email to