Bug in rsync? (--delete[-after])

Kjell Andresen kjell.andresen at usit.uio.no
Thu Sep 9 10:01:44 GMT 2004


I think I've found a bug in some (older) versions of rsync.

The problem does not seem to have been reported at bugzilla.
And of the 9 bugs found there by searching on "--delete-after"
all have got the name wayned at samba.org attached.

I ask you therefore to check if this problem is found in the newest
version of rsync as well!

I've read the warnings at rsync.samba.org concering when and how to
report bugs/postings to the rsync list.

(It would have been a nice feature to be able to search the complete
archive at http://lists.samba.org/archive/rsync/ for "--delete-after")

The problem is in short that rsync used with the option --delete-after
does NOT delete older files rsynced, but --delete does.

I choosed initially --delete-after to keep copies until all new files
where copied so there should always be an online copy of the file.

The versions I have used is, from [fra (no.)]
hox /# rsync --version
rsync  version 2.5.5  protocol version 26

- and to [til (no.)]:
hox /# ssh anvil rsync --version
rsync  version 2.6.2  protocol version 28

The newer command is on the machine hox:
while read fra til;
 rsync -a -H -p -x --delete --exclude quota.user --exclude quota.group \
 --rsync-path=/rsync $fra/ anvil:$til
done <  /rsynke

The old was the same, just with --delete-after and not --delete

The datafile /rsynke:
i# cat /rsynke
/mn/hox/geofysikk       /mn/anvil/geofysikk
/mn/hox/u4      /mn/anvil/adm-u1
/mn/hox/u6      /mn/anvil/student-u2
/mn/hox/u1      /mn/anvil/ozon-u1
/mn/hox/u8      /mn/anvil/ozon-u2
/mn/hox/u11     /mn/anvil/dynmet-u3
/mn/hox/u10     /mn/anvil/ozon-u4
/mn/hox/student-u1      /mn/anvil/student-u1
/mn/hox/u5      /mn/anvil/hydro-u1
/mn/hox/u9      /mn/anvil/ozon-u3
/mn/hox/u7      /mn/anvil/dynmet-u2
/mn/hox/u2      /mn/anvil/osean-u1
/mn/hox/u3      /mn/anvil/dynmet-u1
/mn/hox/u12     /mn/anvil/slettes-u1

Here is a before and after status of the most troublesome disk; the
first the from-disk and the last two the to-disk; of these the first by
use of --delete-after and the last by use of --delete:

hox /# df -h /mn/hox/u7
Filesystem          Size    Used   Available Capacity  Mounted
enhalvtil#dynmet2    29G     23G       6003M    80%    /mn/hox/u7

hox /# ssh anvil df -h /mn/anvil/dynmet-u2
Filesystem           Size   Used   Available Capacity
tera3scsi#dynmet-u2   52G    50G       2734M    95%    /mn/anvil/dynmet-u2
hox /# ssh anvil df -h /mn/anvil/dynmet-u2
Filesystem            Size  Used   Available Capacity  Mounted
tera3scsi#dynmet-u2    52G   23G         30G    44%    /mn/anvil/dynmet-u2

As you can see --delte removed about 27G files on this filesystem alone.

Kjell Andresen  Systems administrator, University of Oslo, Norway
                Center for Information Technology Services and
                Department of Geosciences

More information about the rsync mailing list