Partial files left on SIGINT

Jon Mitchell jmitchell at messagelabs.com
Thu May 18 15:43:58 GMT 2006


Hi,

As the man page says, the --partial flag is to "keep partially
transferred files". I'm assuming if I don't have partial flag any
partially transferred files should be deleted. However this is not what
I'm seeing.

Example:

(Using a big file so that rsync times a while to run. This gives me time
to hit CTRL-C for the SIGINT).

> mkdir example
> dd if=/dev/zero of=example/big_file bs=1024 count=102400
> ls -l example
-rw-r--r-- 1 jmitchell users 104857600 2006-05-18 16:33 big_file

> rsync -ptgou example/big_file .

# Let it run for a couple of seconds to start running, then hit CTRL-C

rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at
rsync.c(242) [sender=2.6.8]
rsync: writefd_unbuffered failed to write 78 bytes [generator]: Broken
pipe (32)rsync error: error in rsync protocol data stream (code 12) at
io.c(1121) [generator=2.6.8]

> ls -l big_file

ls: big_file: No such file or directory

> ls -l .big_file*

-rw------- 1 jmitchell users 36700160 2006-05-18 16:36 .big_file.b1eEq1


This is I believe a partially transferred copy of .big_file. I would
have expected this to be deleted on the SIGINT, unless I had the
--partial flag set, which I do not.

If I run rsync again and allow it to complete fully without a SIGINT, I
get:

> ls -l big_file

-rw-r--r-- 1 jmitchell users 104857600 2006-05-18 16:33 big_file

> ls -l .big_file*

-rw------- 1 jmitchell users 36700160 2006-05-18 16:36 .big_file.b1eEq1

The partially copied file of the original run remains, so leaving it
doesn't seem to save data transfer the second time rsync is run.

Thanks,
 Jon





______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


More information about the rsync mailing list