Suggested chnage to "--partial" usage.

Jason Potter jasonp at iinet.net.au
Wed Jun 16 12:30:16 GMT 2004


Hi There,

 

This post is brought about due to the following two:

http://www.mail-archive.com/rsync@lists.samba.org/msg10702.html

http://www.mail-archive.com/rsync@lists.samba.org/msg10709.html

 

I have a situation where I need to upload large files over an unstable link
(resuming is a requirement) and only when they are complete can they be
renamed and hence replace the original file.  The process is an automated
one so I don't have the ability to just walk over to the machine and see if
it is finished by manually comparing the file size at the source and
destination.

 

I have looked at the source code and have an alternative suggestion to the
way -partial works.  I am looking for comment on if people think this is a
valid suggestion or am I missing something.

 

1)       In cleanup.c the function _exit_cleanup will call finish_transfer
regardless of the code the function receives as a parameter. (see errcode.h
for the codes it could receive)

2)       Suggest a new function is written to adjust the name of the file
the temp file is written to, to be the correct name plus a know extension.
This achieves the requirement that the original file does not get over
written if the file is not complete.

3)       If the above was implemented you would then just have to adjust the
scyncing code to check for these temporary files and use these to resume the
connections.

4)       When the file is complete _exit_cleanup gets a code value of 0
(zero) and this can be used to call the currently written finish_transfer.

 

So what do you all think, will it work. 

 

I look forward to your responses.

 

Cheers

Jason

 



More information about the rsync mailing list