Results 1 to 3 of 3
Hi All,
We have CRON getting rsync to sync files between a desktop debian/squeez box and a nginx web server, however as we have CRON running sync every 15 minutes, ...
- 04-16-2011 #1Just Joined!
- Join Date
- Apr 2011
- Posts
- 2
Rsync problem
Hi All,
We have CRON getting rsync to sync files between a desktop debian/squeez box and a nginx web server, however as we have CRON running sync every 15 minutes, if a sync is in progress another sync on the same files will start. If the files to sync are large (say video size) we could end up having many sync sessions running which ends up bringing down the server.
In addition to that, if a file is being uploaded to the server to be sync'd with the box, rsync could end up running multiple session on that file too.
Does anybody know a way to prevent a new sync from starting until all other syncs are complete? Or if another sync starts, only checks files that are not currently being sync'd?
Hope all that makes sense, pretty new to this myself.
Thanks
- 04-19-2011 #2Just Joined!
- Join Date
- Mar 2005
- Location
- Corona, CA
- Posts
- 29
1. If rsyncs are overlapping, don't run them so close to each other.
2. On the server with the cronjob, put the rsync command in a script. Have the script create an empty file somewhere like /tmp, and then start rsync. When rsync finishes, rm the empty file. Now up above all that put an if statement that checks for that file. If the file exists, exit. If the file doesn't exist, create the file and start the rsync.
- 04-25-2011 #3Just Joined!
- Join Date
- Apr 2011
- Posts
- 2
Thanks, all sorted now


Reply With Quote
