Need help of exclusion options in rsync-3.0.6

Jignesh Shah jignesh.shah1980 at
Sun Jul 26 10:07:05 MDT 2009


I have a situation where I want to delete some of my excluded patterns but
still want to preserve some other. For example consider below source and
destination directory hierarchy.

  Source                    Dest
  ----------                   ---------
/foo/bar/                  /foo/bar/
    | -> baz                  | -> baz
    | -> xyz                  | -> xyz
    | -> abc                  | -> abc
                                 | -> old-baz

I am below comand using --delete-excluded  and as a result rsync deletes
exluded directories "baz" and "abc" and also deletes "old-baz". I want to
preserve the "old-baz" and "baz" directories on destination side and want
"abc" to gets deleted. Could you tell me how to tell rsync to do this?

rsync -avz /foo/bar/ --delete-excluded --exclude=/baz --exclude=/abc

Is there any option like --preserve-excluded available?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list