Hello, I've googled but not found exactly what I want. I want to transfer *.log from all directories and subdirectories of /var. Directories have to be created remotely only if files match How do you do this ? I try rsync -an --progress --files-from=/tmp/source --filter=": /tmp/pattern" / 10.156.1.1:/home/toto where /tmp/source contains /var and /tmp/pattern contains *.log It gives me that : var/ var/log/ var/log/Xorg.0.log var/log/Xorg.0.log.old var/log/aptitude ... var/log/daemon.log.1.gz var/log/daemon.log.2.gz var/log/daemon.log.3.gz var/log/debug var/log/debug.0 var/log/debug.1.gz var/log/debug.2.gz ...... var/log/fsck/ var/log/ksymoops/ var/log/news/ var/log/samba/ By example(here), I don't want : var/log/Xorg.0.log.old var/log/daemon.log.1.gz, etc... Thx in advance
On Tue 13 Nov 2007, Isma?l BALLO wrote:> > I've googled but not found exactly what I want. > I want to transfer *.log from all directories and subdirectories of /var. > Directories have to be created remotely only if files matchThat last restriction is a bit of a spoiler, but ignoring that, this is how I'd do it: rsync -an --progress --include '*/' --include '*.log' --exclude '*' /var 10.156.1.1:/home/toto But if you're using --files-from anyway, why not use find to get the list of files and don't let rsync recurse... Paul Slootman