OS/X Leopard Server and rsync backups
soltys at ziu.info
Sat Jun 21 00:26:36 GMT 2008
Greg Shenaut wrote:
> --delete-excluded : delete files no longer present & any excluded files
You can achieve the same with 'H' or 'R' instead of '-', without having
to specify --delete-excluded. 'H' is sender-only exclude, 'R' is
In your case:
will cause the extra file on the receiving side to disappear, unless
it's matched by some other rule later, that would protect it otherwise.
would work as expected as well. Extra file on the receiver would be
deleted, if it wasn't transferred - sender will not send it, and 'R'
will match before '-' on the receiving side. But e.g. 'someotherfile'
would match '-' on both sides, so it wouldn't be deleted, if it wasn't
> --link-dest=$OLD : copy only files that are different from those in
> directory $OLD
and hardlink the unchanged ones.
> // : the base of the source tree is the filesystem root directory
One slash is enough.
> A line of the form ": .rsync-filter" means incorporate filter rules from
> any .rsync-filter file found and apply them to everything in and beneath
> its directory.
Yes. Careful about delete modes though - you will need --delete-after,
if the per-dir rules are being transferred, and they differ from the
ones already present on the receiving side (and you expect the new ones
to influence deletions).
> The line "- */.Trash" means don't copy any .Trash file, even the one in
> the root directory.
* alone will match any non-empty component, so .Trash (dir or file) in
the root will not be excluded.
would do the thing - the rule is inherited in every subdirectory (unless
you inhibit that with .n $FLTR ), so it will match anything .Trash it
> The line "- .Spotlight-*/" means copy all directories whose names match
> ".Spotlight-*" but nothing beneath them.
This one will exclude any directory that matches .Spotlight-* . So
neither dir, nor its contents will be copied (as rsync won't visit the
directory in the first place). If you have regular file matching
.Spotlight-*, it will be copied though.
Btw - try running some test case rsync with -vv / -vvv / -i and/or with
custom logging options - you will see when and how rsync does things.
More information about the rsync