Added rsync+stunnel link.
[rsync-web.git] / backup.txt
1 #!/bin/sh
2
3 # This script does personal backups to a rsync backup server. You will end up
4 # with a 7 day rotating incremental backup. The incrementals will go
5 # into subdirectories named after the day of the week, and the current
6 # full backup goes into a directory called "current"
7 # tridge@linuxcare.com
8
9 # directory to backup
10 BDIR=/home/$USER
11
12 # excludes file - this contains a wildcard pattern per line of files to exclude
13 EXCLUDES=$HOME/cron/excludes
14
15 # the name of the backup machine
16 BSERVER=owl
17
18 # your password on the backup server
19 export RSYNC_PASSWORD=XXXXXX
20
21
22 ########################################################################
23
24 BACKUPDIR=`date +%A`
25 OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES 
26       --delete --backup --backup-dir=/$BACKUPDIR -a"
27
28 export PATH=$PATH:/bin:/usr/bin:/usr/local/bin
29
30 # the following line clears the last weeks incremental directory
31 [ -d $HOME/emptydir ] || mkdir $HOME/emptydir
32 rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
33 rmdir $HOME/emptydir
34
35 # now the actual transfer
36 rsync $OPTS $BDIR $BSERVER::$USER/current