Constantin Teodorescu
2006-Jun-13 19:53 UTC
Partial transferred files useless at resume, compare-dir can help ?
So, my use case is : 1. lot of connections over dial-up lines 2. need to transfer safely A SINGLE BZIPPED FILE to the server 3. if dial-up line fails, it's automatically restarted after 5 minutes and transfer start again I heard about the --partial option in order to keep the partial transferred file. I thought that rsync will apply his incremental check and update alghoritm on that partial file and resume the transfer. Unfortunatelly , the temporary file name is a unique file name ( .mydb-dump.sql.bz2.MkVSHy ) and in the next transfer session it will be another one , so "partial" transfer files does not help me much. Can "--compare-dir" help me? I need a good , reliable , transfer of a binary file that can be resumed in the next transfer session if possible. I need also a good and atomic "switch" of the new succesfull transfered file with the existing one, keeping (if possible) a backup file of it. The workstations are using rsync version 2.6.3.pre1 with protocol version 28 , the server is using rsync version 2.6.8 protocol version 29. Thanks for the help, Teo
Matt McCutchen
2006-Jun-13 20:24 UTC
Partial transferred files useless at resume, compare-dir can help ?
On Tue, 2006-06-13 at 22:00 +0300, Constantin Teodorescu wrote:> I heard about the --partial option in order to keep the partial > transferred file. I thought that rsync will apply his incremental check > and update alghoritm on that partial file and resume the transfer. > > Unfortunatelly , the temporary file name is a unique file name ( > .mydb-dump.sql.bz2.MkVSHy ) and in the next transfer session it will be > another one , so "partial" transfer files does not help me much.If you use --partial and the transfer is interrupted, the receiving rsync moves the partial file over the original when it dies, so the file will be found on the next attempt. However, you say you want an atomic switch, so this won't do.> Can "--compare-dir" help me?No, but --partial-dir does exactly what you want. Use something like --partial-dir=.rsync-partial. When the receiving rsync dies, it will create a directory .rsync-partial and move the partial file from .mydb-dump.sql.bz2.MkVSHy to .rsync-partial/mydb-dumb.sql.bz2. On the next attempt, the receiving rsync will copy the data in the partial file to a new temporary file and continue receiving data where it left off. If the transfer gets interrupted again, rsync will move the new temporary file over the old partial file so it will be there for the next attempt, etc. Only when the complete file has been assembled on the receiver will rsync move it over the original; then rsync will clean up after itself by deleting .rsync-partial . Matt