preventing multiple rsync processes backing up same file with cron backup

Max Arnold lwarxx at gmail.com
Wed Dec 23 01:35:39 MST 2009


On Tue, Dec 22, 2009 at 10:56:21PM -0800, snowc wrote:
> 
> If I have an rsync cron job that runs say every 15 minutes, what happens if
> there is a file that process 1 has started to copy across, but hasn't
> finished before the next process starts?
> 
> Does rsync ignore this partially copied file, or does it try to copy it
> across again in the second cron job?

Probably it is not an rsync job to prevent such cases. You can put to crontab simple shell
script which will do proper locking and execute rsync only if there is no other instances.

For example: http://sysadvent.blogspot.com/2009/12/cron-practices.html


More information about the rsync mailing list