--delete and explicitly listed files

Igor A. Nesterov igor.nesterov at usa.net
Thu Sep 30 15:14:04 GMT 2004


From: "Wayne Davison" <wayned at samba.org>
> This is because rsync is a copy command, and you told it to copy a file
> that doesn't exist.  Rsync does not currently have a way to specify
> individual files to delete,

This is exactly what I am asking for... why? rsync is not just a copy
command. It goes far beyond and has extended features making it a powerful
synchronization tool. This is why we like it so much. 'cp' from dir to dir
does not provide --delete functionality either, so an analogy with copy
command is not an excuse for not having a feature I am looking for. Just
keep in mind that I am not looking for changing _default_ rsync behaviour. I
am asking for an extra feature, which can be turned on by --delete, or by
one of the --delete flavors. My example in the beginning of this thread is a
good ground for the motion. There is no much difference between CASE1 and
CASE2 it it. But the result is drastically different.

> So, you're best off if you keep two lists of files -- a list of
> changed/added files, and a list of deleted files -- but it's easy
> to filter a single list, like this example perl script does:

Perhaps, the biggest problem for us is not that files are not deleted on
target host, but that rsync crashes with exit code 23, when a file on the
list does not exist. To avoid this we have started to do basically what you
are saying. We had to move from statically defined file lists to file lists
gathered dynamically immediately before rsync call. But it does not solve
the problem completely. And your Perl code is not immune to this, either. It
is a live real-time system, so files can be removed between the list
creation and an actual rsync invocation. And then it crashes. We experience
these crashes as often as once per two or three days. It's a real headache.
Otherwise I would not come to this mailing list looking for answers. This is
AT&T Research by the word.

Thanks,

Igor



More information about the rsync mailing list