Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-23-2009, 02:57 AM
|
#1
|
LQ Newbie
Registered: Mar 2008
Posts: 11
Rep:
|
Setting Cron - Options
Hi All,
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?
Regards,
Kurian Thayil.
|
|
|
04-23-2009, 04:04 AM
|
#2
|
Member
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132
Rep:
|
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?
|
|
|
04-23-2009, 04:24 AM
|
#3
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
04-23-2009, 05:17 AM
|
#4
|
LQ Newbie
Registered: Mar 2008
Posts: 11
Original Poster
Rep:
|
Hi,
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.
Regards,
Kurian Thayil.
|
|
|
All times are GMT -5. The time now is 05:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|