rsync 2.6.8 copies directories but not files

Bill Gunter bgunter at arcsystems.com
Wed Jun 7 21:47:01 GMT 2006


I'm using a somewhat complicated --include/exclude chain to copy all
files matching a pattern, plus all files in certain subdirs.

/usr/local/bin/rsync -a 
  --include='*/' --include='*.[wip]' 
  --include='*.htm' --include='*.html' --include='*.off'
  --include='wwwroot/*' --include='perl/*' 
  --exclude='*' 
  newcode/
  checkpt8

This almost works. All files matching *.[wip], *.htm, *.html, *.off in
all subdirs of newcode/ are copied, as are all subdirs. However, of the
files not matching the above patterns in wwwroot/ and perl/, only the
ones in the root of those two directories are copied. Files in subdirs
of wwwroot/ and perl/ are NOT copied.  e.g. after running the above
command on /tmp/test/newcode, which looks like this:

/tmp/test/newcode
/tmp/test/newcode/ws
/tmp/test/newcode/ws/perl
/tmp/test/newcode/q
/tmp/test/newcode/q/foo1.p
/tmp/test/newcode/q/foo1.i
/tmp/test/newcode/q/perl
/tmp/test/newcode/q/perl/stuff
/tmp/test/newcode/q/perl/stuff/stuff.q
/tmp/test/newcode/perl
/tmp/test/newcode/wwwroot
/tmp/test/newcode/wwwroot/foo.gif
/tmp/test/newcode/wwwroot/prod1
/tmp/test/newcode/wwwroot/prod1/images
/tmp/test/newcode/wwwroot/prod1/images/foo47.gif
/tmp/test/newcode/wwwroot/prod1/images/junk
/tmp/test/newcode/wwwroot/prod1/images/junk/foo
/tmp/test/newcode/common

to /tmp/test/checkpt8, I get this:

/tmp/test/checkpt8
/tmp/test/checkpt8/common
/tmp/test/checkpt8/perl
/tmp/test/checkpt8/q
/tmp/test/checkpt8/q/perl
/tmp/test/checkpt8/q/perl/stuff
/tmp/test/checkpt8/q/foo1.i
/tmp/test/checkpt8/q/foo1.p
/tmp/test/checkpt8/ws
/tmp/test/checkpt8/ws/perl
/tmp/test/checkpt8/wwwroot
/tmp/test/checkpt8/wwwroot/prod1
/tmp/test/checkpt8/wwwroot/prod1/images
/tmp/test/checkpt8/wwwroot/prod1/images/junk
/tmp/test/checkpt8/wwwroot/prod1/images/junk/crap.p
/tmp/test/checkpt8/wwwroot/foo.gif

All the subdirs of wwwroot/ are copied, but only foo.gif and crap.p are
copied. prod1/images/foo47.gif is not copied.

This is very strange.

-- 
Bill Gunter 
Assistant Director of Information Systems 
  
ARC Systems 
P: 512.358.5377 
F: 512.892.5552 
<www.arcsystems.com>



More information about the rsync mailing list