Linux rsync
Uit Rolandow
Versie door Rolandow (Overleg | bijdragen) op 30 jun 2011 om 13:08 (Nieuwe pagina aangemaakt met '= examples of exclude list = <pre> Here are some examples of exclude/include matching: o "- *.o" would exclude all names matching *.o o …')
examples of exclude list
Here are some examples of exclude/include matching:
o "- *.o" would exclude all names matching *.o
o "- /foo" would exclude a file (or directory) named foo in the transfer-root directory
o "- foo/" would exclude any directory named foo
o "- /foo/*/bar" would exclude any file named bar which is at two levels below a directory named foo in the transfer-root directory
o "- /foo/**/bar" would exclude any file named bar two or more levels below a directory named foo in the transfer-root directory
o The combination of "+ */", "+ *.c", and "- *" would include all directories and C source files but nothing else (see also the --prune-empty-dirs option)
o The combination of "+ foo/", "+ foo/bar.c", and "- *" would include only the foo directory and foo/bar.c (the foo directory must be explicitly included or it would be excluded by the "*")
The following modifiers are accepted after a "+" or "-":
o A / specifies that the include/exclude rule should be matched against the absolute pathname of the current item. For example, "-/ /etc/passwd" would exclude the passwd file any time the transfer was sending files from
the "/etc" directory, and "-/ subdir/foo" would always exclude "foo" when it is in a dir named "subdir", even if "foo" is at the root of the current transfer.
o A ! specifies that the include/exclude should take effect if the pattern fails to match. For instance, "-! */" would exclude all non-directories.
o A C is used to indicate that all the global CVS-exclude rules should be inserted as excludes in place of the "-C". No arg should follow.
o An s is used to indicate that the rule applies to the sending side. When a rule affects the sending side, it prevents files from being transferred. The default is for a rule to affect both sides unless
--delete-excluded was specified, in which case default rules become sender-side only. See also the hide (H) and show (S) rules, which are an alternate way to specify sending-side includes/excludes.
o An r is used to indicate that the rule applies to the receiving side. When a rule affects the receiving side, it prevents files from being deleted. See the s modifier for more info. See also the protect (P) and risk
(R) rules, which are an alternate way to specify receiver-side includes/excludes.
o A p indicates that a rule is perishable, meaning that it is ignored in directories that are being deleted. For instance, the -C optionâs default rules that exclude things like "CVS" and "*.o" are marked as perishable,
and will not prevent a directory that was removed on the source from being deleted on the destination.