Find the answer to your Linux question:
Results 1 to 3 of 3
Hello Guys, I have a script which is kicked off by Cron once every minute. Generally speaking the script only takes a few short seconds to execute, however, on occasions ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    49

    [SOLVED] 1 Minute Cron Job


    Hello Guys,

    I have a script which is kicked off by Cron once every minute. Generally speaking the script only takes a few short seconds to execute, however, on occasions where the system is under heavy load of for other issues (slow internet connection) the script will take more than 60 seconds to execute.

    Now, is there a risk that I could end up with two instances of the script running at the same time? or is cron smart enough to not let that happen?

    I can build safe guards into my script to stop it happening I just wanted to be sure that it was worth me putting the work in if cron doesn't protect me against this anyway.

    I'd appreciate your thoughts,

    Rob

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    No, cron will do whats its programmed to do, it will run the second instace of the script, and you will have to put the work on your script.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    49
    Thanks for that my man, I'll factoring a failsafe on my script.

    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •