include-from or files-from
Steven Levine
steve53 at earthlink.net
Thu Oct 28 11:01:08 MDT 2010
In <AANLkTi=Z1BPCuh-BhfqC0e7cUdin2pkgHXDAv9JQSwC3 at mail.gmail.com>, on
10/25/10
at 10:18 AM, ml ml <mliebherr99 at googlemail.com> said:
Hi,
Please reply to the list.
>mario at mario-laptop:~/foo2$ find .
>.
>./include.txt
>./file-also-included
>./path
>./path/this-file-is-found
>./some
>My rsync command: rsync -avnz --recursive --include-from="include.txt" *
>bar
FWIW, -a implies --recursive.
FWIW, there's no real benefit to -z for local transfers. Less data goes
through the pipes, but the compression logic takes CPU cycles.
As a matter of style, I would use --filter=include.txt, since what you
have is a filter list rather than a simple include list.
>cat include.txt
>+ /some/
>+ /some/path/
>+ /some/path/this-file-is-found
>+ /file-also-included
>- *
>rsync -avnz --recursive --include-from="include.txt" * bar
>sending incremental file list
>created directory bar
>file-also-included
>some/
>sent 89 bytes received 19 bytes 216.00 bytes/sec
>total size is 0 speedup is 0.00 (DRY RUN)
>Why does it not transfer the files recursively?
It does, but you told rsync to ignore all the other directories with -*.
This is a downside of using the paridigm. Depending on your needs,
--prune-empty-dirs may be a better solution.
Also, to be consistent with your find finds, you command line needs to be
rsync -n -ai --filter=include.txt ./ bar
Steven
--
----------------------------------------------------------------------
"Steven Levine" <steve53 at earthlink.net> eCS/Warp/DIY etc.
www.scoug.com www.ecomstation.com
----------------------------------------------------------------------
More information about the rsync
mailing list