Warum nicht -a statt -t -p -o -g ...?
Zu den Regeln, mit ein paar mehr -v -v dazu gibt rsync aus was es wieso ablehnt.
[sender] hiding directory a/.local because of pattern .*
Die werden also abgelehnt weil das Unterverzeichnisse sind und die Include-Regel fürs Unterverzeichnis nicht zuerst getestet wird...
Das hier funktioniert (für .local/share/gajim) aber das kann nicht so ganz im Sinne des Erfinders sein:
--include=.local --include=.local/share --include=.local/share/gajim --exclude=.* --exclude=.local/* --exclude=.local/share/*
Aus 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 subcomponent’s
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 par‐
ticularly important when using a trailing ’*’ rule. For instance, this
won’t work:
+ /some/path/this-file-will-not-be-found
+ /file-is-included
- *
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:
+ /some/
+ /some/path/
+ /some/path/this-file-is-found
+ /file-also-included
- *
Irgendwie umständlich... 😉
Wenn man die Bash expandieren läßt, vielleicht so schreiben: (auf eigene Gefahr)
rsync -a --include=.{thunderbird,mozilla,tvbrowser,gnupg,config,config/gajim,local,local/share,local/share/gajim} --exclude=.{*,gnupg/random_seed,config/*,local/*,local/share/*} src dest
Das entspricht dann rsync -a --include=.thunderbird --include=.mozilla --include=.tvbrowser --include=.gnupg --include=.config --include=.config/gajim --include=.local --include=.local/share --include=.local/share/gajim --exclude=.* --exclude=.gnupg/random_seed --exclude=.config/* --exclude=.local/* --exclude=.local/share/* src dest