[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rsync - mehrere Quellargumente?


Am Montag, 2010-10-25 19:29:47 schrieb Christian Ordig:

> schau Dir mal die Beschreibung folgender Optionen an:
> --exclude=PATTERN       exclude files matching PATTERN
> --exclude-from=FILE     read exclude patterns from FILE
> --include-from=FILE     read include patterns from FILE
> --files-from=FILE       read list of source-file names from FILE

Aha, "--include", mir war nicht klar, dass man damit auch ganze 
Verzeichnisse includieren kann. Dennoch bleibt noch einiges unklar.
Ich lese ich in der Manpage:

-------------------------------------------------------------------
Note that, when using the --recursive (-r) option (which is implied 
by -a), every subcomponent of every path is visited from the top 
down, so include/exclude patterns get applied recursively to each 
subcomponents full name (e.g. to include /foo/bar/baz the 
subcomponents /foo and /foo/bar must not be excluded).
The exclude patterns actually short-circuit the directory traversal 
stage when rsync finds the files to send.  If a pattern excludes a 
particular parent directory, it can render a deeper include pattern 
ineffectual because rsync did not descend through that excluded 
section of the hierarchy.  This is particularly important when using 
a trailing * rule. For instance, this wont work:

CW+ /some/path/this-file-will-not-be-found
CW+ /file-is-included
CW- *

This fails because the parent directory some is excluded by the
* rule, so rsync never visits any of the files in the some or 
some/path directories. One solution is to ask for all directories in 
the hierarchy to be included by using a single rule: + */
(put it somewhere before the - * rule), and perhaps use the
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--prune-empty-dirs option. Another solution is to add specific 
include rules for all the parent dirs that need to be visited.  For 
instance, this set of rules works fine:

CW+ /some/
CW+ /some/path/
CW+ /some/path/this-file-is-found
CW+ /file-also-included
CW- *
-------------------------------------------------------------------

Die markierten Stelle impliziert, dass die Reihenfolge eine Rolle 
spielt. Aber wenn dem so ist, dann verstehe ich "this-file-will-not-
be-found" im ersten Beispiel nicht, schliesslich wird auch im ersten 
Beispiel erst inkludiert, dann excludiert.

Das wuerde ich gern verstehen um dann z.B. so etwas zu erreichen:

"/home/werner/.kde/"    excludieren, trotzdem aber
"/home/werner/.kde/share/apps/knode/folders/"    inkludieren.
-- 
Viele Gruesse
Werner Holtfreter
-- 
UUGRN e.V. http://www.uugrn.org/
http://mailman.uugrn.org/mailman/listinfo/uugrn
Wiki: https://wiki.uugrn.org/UUGRN:Mailingliste
Archiv: http://lists.uugrn.org/