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
Suggestions?
Craig
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
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
At 02:09 PM 3/7/2008, you wrote:
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
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
I think Anne has got the solution here: --exclude-from= switch. I've been using rsync for years and never could get the --exclude= switch to work, but --exclude-from= works a charm. That said, I've always had problems with tar -exclude switches too, so take my advice with a grain o' salt.
Cheers!
On Fri, 2008-03-07 at 19:09 +0000, Anne Wilson wrote:
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
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
---- doesn't work...
(from script) rsync -ncauv --exclude-from='/root/scripts/qm_manual_filter' \ --include='**/*.pdf' $WORKING $WEB_SERVER
# ./sync-qm_manual.scr building file list ... done
sent 29 bytes received 20 bytes 98.00 bytes/sec total size is 0 speedup is 0.00
no files but changing qm_manual_filter to specifics...
# cat qm_manual_filter #+ **/*pdf #- * - *.ods - *.odt - *.ott - *.eps - Build-PDF/
did work, so I guess the simplest form is to just do this...
# tail -n 1 script... rsync -ncauv \ --filter='. /root/scripts/qm_manual_filter' \ $WORKING $WEB_SERVER
# cat qm_manual_filter + **/*pdf - *.ods - *.odt - *.ott - *.eps - Build-PDF/
which ultimately does what I want, I think.
Thanks
Craig
Craig White wrote:
On Fri, 2008-03-07 at 19:09 +0000, Anne Wilson wrote:
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
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
doesn't work...
(from script) rsync -ncauv --exclude-from='/root/scripts/qm_manual_filter' \ --include='**/*.pdf' $WORKING $WEB_SERVER
# ./sync-qm_manual.scr building file list ... done
sent 29 bytes received 20 bytes 98.00 bytes/sec total size is 0 speedup is 0.00
no files but changing qm_manual_filter to specifics...
# cat qm_manual_filter #+ **/*pdf #- *
- *.ods
- *.odt
- *.ott
- *.eps
- Build-PDF/
did work, so I guess the simplest form is to just do this...
# tail -n 1 script... rsync -ncauv \ --filter='. /root/scripts/qm_manual_filter' \ $WORKING $WEB_SERVER
# cat qm_manual_filter
- *.ods
- *.odt
- *.ott
- *.eps
- Build-PDF/
which ultimately does what I want, I think.
here's a stupid hack . . . .
cd /base/dir/of/pdfs find . -type f -name '*.pdf' -print > list for f in `cat list`; do ( test ! -d /dest/`dirname $f`` && mkdir -p /dest/`dirname $f`` ) rsync -av $f /dest/$f done
On Fri, Mar 7, 2008 at 6:25 PM, Toby Bluhm tkb@midwestinstruments.com wrote:
Craig White wrote:
On Fri, 2008-03-07 at 19:09 +0000, Anne Wilson wrote:
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...
- Build-PDF/
If you don't mind replicating empty subdirs:
rsync -va --include "*.avi" --include "*/" --exclude "*" $WORKING $WEB_SERVER
On Fri, Mar 7, 2008 at 4:26 PM, Marcelo Roccasalva marcelo-centos@irrigacion.gov.ar wrote:
If you don't mind replicating empty subdirs:
rsync -va --include "*.avi" --include "*/" --exclude "*" $WORKING $WEB_SERVER
The option "--prune-empty-dirs" does the trick!
rsync -av --include '*.pdf' --include='*/' --exclude='*' --prune-empty-dirs "$WORKING" "$WEB_SERVER"
Note: I'm using rsync 3.0.0 from rpmforge repository, I don't know if it's available in rsync 2...
Filipe
On Fri, Mar 7, 2008 at 11:20 PM, Filipe Brandenburger filbranden@gmail.com wrote:
On Fri, Mar 7, 2008 at 4:26 PM, Marcelo Roccasalva marcelo-centos@irrigacion.gov.ar wrote:
If you don't mind replicating empty subdirs:
rsync -va --include "*.avi" --include "*/" --exclude "*" $WORKING $WEB_SERVER
The option "--prune-empty-dirs" does the trick!
rsync -av --include '*.pdf' --include='*/' --exclude='*' --prune-empty-dirs "$WORKING" "$WEB_SERVER"
Note: I'm using rsync 3.0.0 from rpmforge repository, I don't know if it's available in rsync 2...
Yes! 2.6.9 at least...
On Fri, Mar 7, 2008 at 12:40 PM, Craig White craig@tobyhouse.com 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
excludes everything
I am using -n for dry-run I definitely need recursive but -a option handles that
Suggestions?
Include/exclude is a pain in the you know what. Very finicky.
Perhaps try **/*.pdf as the include patterns are directory sensitive. I don't think a simple *.pdf will apply recursively.
-- Jeff