I must be seriously misunderstanding the man page coverage of --filter. If I have a dir 'foo/' in the reciver with content 'bar' that I must keep and a 'foo/' on the sender side empty what could possibly be the best way to get the job done? Till now the filter option gone ignored.. Not to mention that at the moment (may be because my bad english, sorry!) I can not find the right syntax.. my script is this: # SHORTHOST=`hostname | awk 'BEGIN { FS="." } { print $1 }'` cd $HOME || exit 1 rsync -n -v -stats -z -a -x \ --filter=':r .bar' --filter=':r foo/' \ --delete-after --delete-excluded --exclude-from=$HOME/.rsync/exclude \ --timeout=999 --log-file=/home/user/log.rsync \ -e 'ssh -p 3434 -c 3des -i .ssh/identity -ax -o ClearAllForwardings=yes' \ $HOME/ root@server:/home/.BKP/$SHORTHOST and my exclude is : - .cache - .gvfs - .gconf - .gconfd - .mozilla/**/Cache - .mozilla/firefox/*/lock - .mozilla/firefox/*/.parentlock - Desktop/Exclude - media <Snip> Where I get it wrong? Thanks folks for reading this long post! Fred -- istrice <istrice@autistici.org>
On Thu, 23 Apr 2009 14:02:26 +0200 istrice <istrice@autistici.org> wrote:> I must be seriously misunderstanding the man page coverage of --filter. > If I have a dir 'foo/' in the reciver with content 'bar' that I must > keep and a 'foo/' on the sender side empty what could possibly be the > best way to get the job done?Until now I've done this by adding "- foo/" on the exclude file. With this line rsync will not touch any "foo/" directory on the receiver. I don't see yet the advantage of using "--filter" over "--exclude" but I hope someone can give a practical example. Thanks
On Thu, Apr 23, 2009 at 02:02:26PM +0200, istrice wrote:> --filter=':r .bar'This indicates that you want the file .bar to be read at every level of the destination hierarchy and its contents to be interpreted as filter commands. That would let you specify localized filtering.> --filter=':r foo/'It doesn't make sense to specify a directory as a merge-file. From your other text I imagine you're trying to protect the "foo" dir's contents from deletion, in which case you should be using a protect (P) rule: --filter='protect foo/' ..wayne..