rsync script from homepage: trouble

Johannes Graumann graumann at caltech.edu
Thu Sep 23 01:47:39 GMT 2004


Hello,

I'm new to this and am trying to modify the "backup to a central backup
server with 7 day incremental" script from
http://samba.anu.edu.au/rsync/examples.html to suit my situation.

I have ended up with the script attached below and when running it from
command line I get these errors:

rsync error: syntax or usage error (code 1) at main.c(726)

and a plethora of this

> make_bak_dir mkdir "/home/Wednesday" failed: Permission denied
> stat "/home/Wednesday/home/USER/N14_N15/013_072604/SGD_N14/chro"
> failed: No such file or directory

Can somebody please have a look on what I did and point me the right
way? As I said: I'm new to rsync and have little experience with shell
scripting ...

Thanks, Joh

Script:

#!/bin/sh

# This script does personal backups to a rsync backup server. You will
# end up with a 7 day rotating incremental backup. The incrementals
# will go into subdirectories named after the day of the week, and the
# current full backup goes into a directory called "current"
# tridge at linuxcare.com

# directory to backup
BDIR=/home

# excludes file - this contains a wildcard pattern per line of files to
# exclude.
# Your excludes files tells rsync what NOT to backup. Leave it
# unchanged if you want to backup all files in your SOURCES. If
# performing a FULL SYSTEM BACKUP, ie.
# Your SOURCES is set to "/", you will need to make use of EXCLUDE_FILE.
# The file should contain directories and filenames, one per line.
# An example of a EXCLUDE_FILE would be:# /proc/
# /tmp/
# /mnt/
# *.SOME_KIND_OF_FILE
EXCLUDES=$HOME/cron/excludes

# the name of the backup machine
BSERVER=user at BACKUPSERVER

ssh-add ~/.ssh/root\@SERVER_backup

########################################################################

BACKUPDIR=`date +%A`
#OPTS="-e ssh --force --ignore-errors --delete-excluded
#--exclude-from=$EXCLUDES#      --delete --backup
#--backup-dir=/$BACKUPDIR -a" 
OPTS="-e ssh --force --ignore-errors --delete --backup \
--backup-dir=/home/$BACKUPDIR -a"

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
#rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
rsync -e ssh --delete -a \
$HOME/emptydir/$BSERVER:/aule/data_rsync/$BACKUPDIR/ 
rmdir $HOME/emptydir

# now the actual transfer
#rsync $OPTS $BDIR $BSERVER::$USER/current
rsync $OPTS $BDIR $BSERVER:/aule/data_rsync/current

ssh-add -d ~/.ssh/root\@aule_backup



More information about the rsync mailing list