files not moved immediately to final destination from temp location after rsync returns with success

Brian K. White brian at
Mon Apr 25 11:39:00 MDT 2011

On 4/25/2011 8:10 AM, Alistair Dsouza wrote:
> The two rsync calls had a delay of 180 seconds between them but when the
> issue was seen the debug prints from the second rsync call were
> interspersed with the debug logs of the first rsync call. Our system
> startup scripts start just one instance of the script which has the two
> rsync calls. Also when the issue was later detected there was one
> instance of that script running.
> Have you come across errors with bash scripts where they run the command
> in the background even when not specified to. If so then that seems to
> be an explanation as to what took place.
> We did not see any SD card errors or file system errors in general.
> Regards,
> Alistair

I use rsync a lot in a lot of scripts for all manner of special 
purposes, on various different platforms too, and I never had or even 
heard of any such problem with rsync as you describe. I never saw or 
heard of shell running jobs in the backgound asynchronously without 
being asked to so I don't think it's that either. (oh it certainly might 
be running in the background, but I doubt it's without being told to)

But I have had no small number of similar problems that were plain my 
error in scripting or coding, or in configuring cron or some other 
service, or in a couple cases bugs in cron that resulted in duplicate jobs.

So I think you have a scripting or other systemic problem to track down.

It's possible you discovered a way to make rsync misbehave in that way, 
but you will have to prove it in order to provide the info needed for 
anyone else to debug it anyways. And in setting up and using the 
instrumentation to gather that proof, I bet you will end up discovering 
what's really wrong.


> On Sat, Apr 23, 2011 at 9:06 PM, Wayne Davison <wayned at
> <mailto:wayned at>> wrote:
>     On Wed, Apr 20, 2011 at 12:44 PM, Alistair Dsouza
>     <alistaird at <mailto:alistaird at>> wrote:
>         I came across an issue where it seems that the rsync call
>         returned with a success but the files that it pulled are
>         not moved immediately to its final destination.
>     I think it more likely that you had 2 instances of the script
>     running at the same time.  You could use something like "shlock" to
>     prevent that from happening.
>     ..wayne..

More information about the rsync mailing list