Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 04-23-2009, 02:57 AM   #1
LQ Newbie
Registered: Mar 2008
Posts: 11

Rep: Reputation: 0
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?


Kurian Thayil.
Old 04-23-2009, 04:04 AM   #2
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
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?
Old 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: Reputation: 122Reputation: 122
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.
Old 04-23-2009, 05:17 AM   #4
LQ Newbie
Registered: Mar 2008
Posts: 11

Original Poster
Rep: Reputation: 0

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.


Kurian Thayil.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with setting up a cron juancha Linux - Newbie 2 11-07-2006 07:28 PM
setting up language input options tsuren Slackware 4 10-27-2006 09:11 PM
Setting a cron nitaish Linux - General 6 11-03-2004 07:43 AM
Setting nvidia options? EnVoy Mandriva 1 04-05-2004 09:22 PM
need help setting up a cron job !! J.I.L. Linux - Software 1 10-19-2003 08:54 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration