"rsync --delete" won't delete certain files

Peter Daum gator_ml at yahoo.de
Sun Mar 22 15:25:44 GMT 2009


as I just discovered, in recent versions of rsync the "--delete" option
seems to not work in certain cases. I couldn't come up with a simple
scenario to reproduce the problem, so I'll have to tell the whole story:

I use rsync to regularly backup a system onto other disks. The filesystems
I want to save are mounted on "/", "/usr/ and "/data", the target is below
"/backup" (and has "/backup/usr" and "/backup/data" on separate file systems).

the rsync command line looks like this:
rsync [other options ...] -a --delete / /usr /data /backup/

For some reason, it seems like old data below /backup/var will never be deleted
again I don't see any reason why "/var" would be treated somehow special, but I
couldn't find another directory where this phenomenon also occurs; the "other
options" don't include anything referring to "/var". New data below "/var" will
be synced, but when files below "/var" are deleted, they will stay on
"/backup/var". I don't know when this started (fortunately, I didn't need the
backup data recently ;-), I just discovered it when the partition on "/backup/"
ran out of space. This happened with rsync 3.03; I also tried 3.05 with the same
result. When I tried the same command line using rsync 2.6.3, the leftover data
on /backup/var/ was finally deleted. However, I would rather use a recent version.

Any idea what is going on?

                           Peter Daum

More information about the rsync mailing list