Copying only *.files from tree
maxb at ukf.net
Fri Sep 13 17:55:00 EST 2002
Gilson Soares wrote:
> I'd like to replicate a directory structure but only copying
> *.<anything> files.
> rsync -a --include="*.rrd" --exclude="*" /var/www/html
> Didn't work.
> One additional issue is *.rrd files only exists 2 levels bellow
> /var/www/html/, not in /var/www/html itself.
> Do I missed something ?
Yep, you excluded everything (including subdirs) that doesn't match *.rrd. So
rsync never got into the subdirs to see the *.rrd files inside them.
Try: --include="*.rrd" --include="**/" --exclude="*". That middle include will
include all subdirs, down to any depth in the tree (**).
More information about the rsync