Don van der Haghen
2003-Apr-09 00:56 UTC
rsync incremental backup problem with --backup-dir switch
Hello, I am using rsync v2.5.6 to backup our entire server filesystem over the network to a central backup server. I have copied the example script from the rsync website (http://rsync.samba.org/examples.html) to create incremental backups, the --backup-dir seems to have a strange side-effect. Everything goes well, but on the server side where the backup is stored I can't seem to break out of the $BSERVER::$USER/current directory with e.g. the --backup-dir=/Monday switch. Which results in the directories being endlessly moved into eachother, like this: /backup/rtr-heijen/current/Tuesday/Monday/Sunday/Saturday/Friday Instead, the moved files should be located in /backup/rtr-heijen/Monday and not /backup/rtr-heijen/current/Monday I have read all documentation and examples I could find in order to find a solution, but I could not find any. Either I am missing something here, the example on the website is incorrect or some bug has gotten into rsync. Here is the script I am using, with some irrelevant pieces/comments stripped: ---- cd / # directory to backup BDIR=/ # Override the user USER=rtr-heijen # excludes file (Works well) EXCLUDES=/etc/rsync-exclude # the name of the backup machine BSERVER=192.168.1.7 # your password on the backup server export RSYNC_PASSWORD=SomePassword BACKUPDIR=`date +%A` # Results in 'Monday', 'Tuesday', etc. # Maybe some mistake here OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES --delete --backup --backup-dir=/$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 /usr/bin/rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/ rmdir $HOME/emptydir # now the actual transfer rsync $OPTS $BDIR $BSERVER::$USER/current ---- Thanks in advance for any help you can provide me with. Yours sincerely, Don van der Haghen don@avg-online.com