[CentOS] rsync

Fri Mar 7 19:09:40 UTC 2008
Anne Wilson <cannewilson at googlemail.com>

On Friday 07 March 2008 18:40:03 Craig White wrote:
> I've gone over and over the man page and I don't get it and it's
> obviously a simple task
>
> I want to rsync a directory but only the pdf files...
>
> rsync -ncauv --include=*.pdf $WORKING $WEB_SERVER
> # sync's everything, I want to exclude stuff
>
> rsync -ncauv --filter='+ *.pdf' --filter='+ *.odt *.ott *.eps' \
> $WORKING $WEB_SERVER
> # sync's everything...does not seem to exclude anything
>
> rsync -ncauv --filter='. /root/scripts/qm_manual_filter' \
> $WORKING $WEB_SERVER
> # cat qm_manual_filter
> - *
> + *pdf
>
> excludes everything
>
> I am using -n for dry-run
> I definitely need recursive but -a option handles that
>
I don't know if it would work, but could you 
use --exclude-from=/path/to/skiplist.txt to exclude everything then use your 
filter line to add .pdfs back?

I've not tried adding anything back after excluding.  You can certainly use 
wild cards in your skiplist, such as *.odt *.ott *.eps

Anne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.centos.org/pipermail/centos/attachments/20080307/02e0b07c/attachment-0005.sig>