rsync and network failure

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Thu Apr 7 08:53:45 UTC 2016



On 2016-04-07 09:21, Colin Law wrote:
> On 6 April 2016 at 14:57, Dave Howorth <dhoworth at mrc-lmb.cam.ac.uk> wrote:
>>
>>
>> On 2016-04-06 14:43, Colin Law wrote:
>>>
>>> I have a script that I run to keep a remote backup of a folder
>>> heirarchy.  The script uses rsync with a command of the form
>>>
>>> rsync -H -azipc /path/to/backup user at my.remote.domain:destination_folder
>>>
>>> This works fine.  My question is, if the network fails part way
>>> through, or the PC is shut down then should I just be able repeat the
>>> command and rsync will transfer any remaining files that were not
>>> successfully transferred the first time?
>>
>>
>> I've never had any trouble. I've used dirvish for backups and downloads for
>> many years, which uses rsync, and I've experienced various network problems.
>> Dirvish just retries the rsync and normally the transfer completes the
>> second time.
>>
>> Worst case on the rare occasion things somehow get completely mangled is
>> just to delete the faulty image, but I usually do that after the following
>> day's transfer has completed successfully.
>
> You say you have never had any trouble, but then say that on rare
> occasions things get mangled.  The two statements appear to be in
> conflict.

Sometimes it is not possible for rsync to recover. For example when the 
source server goes away permanently (because it has moved to a new 
address), or the DNS gets messed up, or the rsync version is changed at 
one end but not the other, or ... I'm sure there are more cases but I 
don't remember them all.

>  The reason I am asking is that this is intended to be an
> automatic unattended operation (weekly via cron or something similar)
> and I need to know that it won't get mangled, and

I left it unattended for over a year at one point. No screams from the 
users.

TL;DR => This:

> the worse that will
> happen is that the archive will be out of sync until the next time it
> is run.
>
> Colin
>



More information about the ubuntu-users mailing list