Rsync cron jobs

mbe9a

Cadet
Joined
Jul 27, 2020
Messages
3
I'm pretty new to FreeNAS and rsync and need a little help setting up an rsync cron job.

It's pretty simple to set up the basic cron job, but how can I make sure that a new rsync job won't start until the old one finishes. For example, if I start to upload a 100GB file and have the cron job frequency set to every hour (or even faster) will I run into issues if a second rsync job starts while the first continues to run? Is this something I should try to avoid?

If so, how would you recommend ensuring that the new rsync task won't run if there is an rsync task currently running on the same mount point. I have checked out this thread: how can you see if an rsync job is running or finished? But I'd like to be able to differentiate between three unique rsync jobs on three different mount points. "ps ax | grep rsync" doesn't seem to give me any information that would help me differentiate between the three jobs. Additionally, there is no lock (checking with fstat) on any of the directories so that doesn't help.
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
Why setup RSync as a Cron Job when there are dedicated tasks for RSync which will avoid them being run twice. I have an RSync task running hourly between my two FreeNAS/TrueNAS servers, but it will not start again until the previous job has finished
 
Top