Hi,
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?
Regards,
Peter Daum
Hello, Peter, Are there any errors while doing the rsync? I have recently discovered that to create identical copy on mac os x (in the presence of any errors), you need to additionally specify -- ignore-errors and --force-delete, otherwise nothing will be deleted (it seems that as soon as any error is encountered, delete is switched off). izidor On 22.3.2009, at 16:25, Peter Daum wrote:> Hi, > > 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:
Hi,
I still couldn't find a really simple test case but at least I can
provide some more details regarding this obscure issue:
- The problem only occurs when there is more than 1 file system to
sync. When I only backup "/", everything is fine, when I add
another
source file system, nothing below "/var" will be deleted (I still
don't
have a clue, why this occurs on "/var" but not on other paths)
- The issue has been around for quite a while: It has been introduced by
some change between rsync 2.6.4 and 2.6.5
Regards,
Peter Daum
Peter Daum wrote:> 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?