Bug or undesired behavior when quota exceeded

Janusz Jurski jurskij at wp.pl
Thu Nov 8 11:30:48 GMT 2007


Hi,

I have just noticed an undesired behavior when using rsync when disk 
quota is exceeded. I do not know how to avoid it (or maybe it can be 
considered as a bug).

The following is a scenario that leads to the undesired behavior:

1) I normally execute two following commands to synchronize folders 
between a local host and a remote host:
  rsync -aCPvu --existing <dir1> user at host:<dir2>
  rsync -aCPvu --existing user at host:<dir2> <dir1>

2) Assume that files are in-sync on the hosts. Then we change a file on 
the local host. When I execute the first rsync command, the file shall 
be copied to the remote host. When the second command is executed, no 
copying shall occur as the files are in sync after the first command.

3) Unfortunately, it may happen that the disk quota during the first 
command execution is exceeded. I get the following in such a case:
rsync: writefd_unbuffered failed to write 4 bytes [sender]: Broken pipe 
(32)
rsync: write failed on "<dir2>/<file>": Disk quota exceeded (122)
rsync error: error in file IO (code 11) at receiver.c(259) 
[receiver=2.6.9]
rsync: connection unexpectedly closed (219584 bytes received so far) 
[generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) 
[generator=2.6.9]
rsync: connection unexpectedly closed (25270 bytes received so far) 
[sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) 
[sender=2.6.9]

4) The above error is normal and expected.

5) When the second command is invoked, rsync starts copying the file 
from the remote host to the local one. This is an undesired behavior, as 
the file changed on the local host gets overwritten. This is because the 
time of the file on the remote host is left in an incorrect state during 
the first command execution (stopped by the quota limit).

Any idea on how to avoid such a situation? Or maybe we can correct rsync 
code to set file time to the correct one in case of disk quota error?

Regards,
JJ

----------------------------------------------------
Wojna z terrorem wkracza w decydującą fazę:
Robert Redford, Meryl Streep i Tom Cruise w filmie
UKRYTA STRATEGIA - w kinach od 9 listopada!
http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fstrategia.html&sid=90




More information about the rsync mailing list