Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using RHEL 5.2 Server with 3 cron jobs enabled and all are relating to RSYNC. Now, all of these scripts are run once in every 7 minutes all day. The problem occurs when the scripts doesn't finish to execute in 7 minutes. This will result in starting execution of the same script again and this will malfunction the setup.
Is there an option in CRON, which always check if CRON has started the process and is already running? Cron should execute the script only if the the process isn't running. Any hints on this?
If some of these are taking longer then 7 minutes to complete, is there a chance that 7 minutes isn't long enough? I'm assuming increasing this time isn't an option?
I don't think there is such an option. Why don't you put the rsync call in a script, and start by checking for a lock file, if it doesn't exist, create it, rsync then delete it before exiting.
I am aware of this same feature in fcron. So I thought the option is availble in cron and could be enabled/disabled using an keyvalue in its config file. If the feature is not availble in cron then I guess I am left with LOCK file creation and removal during the start and end of Script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.