Include exclude not working

Thomas Schweikle tschweikle at fiducia.de
Tue Feb 26 09:37:00 EST 2002


Hi!

playing with --include, --exclude, and --exclude-from=file I found these
not working:

xcnlm00s:/etc/adsm/script # rsync -navx --include="*/" --exclude="*" -e
ssh newsfeed:/
receiving file list ... done
wrote 29 bytes  read 28605 bytes  3014.11 bytes/sec
total size is 0  speedup is 0.00

xcnlm00s:/etc/adsm/script # rsync -navx --exclude="*" --include="*/" -e
ssh newsfeed:/
receiving file list ... done
wrote 29 bytes  read 44 bytes  13.27 bytes/sec
total size is 0  speedup is 0.00

shouln't the first of these deliver all directories found on host
newsfeed?

Using a exclude/include file the same Problem arose:
newsfeed.lst:
+ */
- *

xcnlm00s:/etc/adsm/script # rsync -navx --exclude-from=newsfeed.lst -e ssh
newsfeed:/
receiving file list ... done
wrote 29 bytes  read 28605 bytes  3014.11 bytes/sec
total size is 0  speedup is 0.00

newsfeed.lst:
+ *
- */

xcnlm00s:/etc/adsm/script # rsync -navx --exclude-from=newsfeed.lst -e ssh
newsfeed:/
receiving file list ... done
wrote 29 bytes  read 28605 bytes  3014.11 bytes/sec
total size is 0  speedup is 0.00

Same. But in "man rsync" is stated:
If you end an exclude list with --exclude ´*´, note that since the
algorithm is applied recursively that unless
you explicitly include parent directories of files you want to include
then the algorithm will stop at the par­
ent directories and never see the files below them.  To include all
directories, use --include ´*/´ before  the
--exclude ´*´.

Thus I would expect the first to include all directories, but no files.
But both versions exclude all directories and files!

--
Thomas






More information about the rsync mailing list