Hi,

I would like to compare a backup dir with a directory list in --compare-dest= but I don't know how to specify this list. If a have only one dir it's ok, but if I have 2 or more dir I have an error ?

Here is my script:

#!/bin/bash

SSH_USER=
SSH_HOST=
TOBCK=/
EXCLUDES=/root/bckscript/ns200176/excludes
LOG=/root/bckscript/ns200176/rsync_$(date +'%Y-%m-%d_%H.%M.S').log

mount /dev/sda1 /mnt/bckhd01

BACKUPDIR=/mnt/bckhd01/ns200176/$(date +'%A')
COMPAREDIR=""
LIST=$(ls /mnt/bckhd01/ns200176/)
for i in $LIST; do
       COMPAREDIR="$COMPAREDIR/mnt/bckhd01/ns200176.ovh.net/$i "
done

OPTS="--verbose --progress --archive --hard-links --ignore-errors --delete-excluded --exclude-from=$EXCLUDES --delete --force --backup-dir=$BACKUPDIR --compare-dest=\"$COMPAREDIR\" --log-file=$LOG"

echo Cleaning previous backup...
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --verbose --delete -a $HOME/emptydir/ $BACKUPDIR/
rmdir $HOME/emptydir


echo Backup start

rsync $OPTS $ssh_u...@$ssh_host:$TOBCK $BACKUPDIR


echo $COMPAREDIR

echo Backup ended


Thanks!


Pv
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to