The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cron jobs problem in cPanel ???

Discussion in 'General Discussion' started by map007, Aug 25, 2009.

  1. map007

    map007 Active Member

    Joined:
    Jun 5, 2008
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I have set cron to run in every five min. but the cron is executing after 1 second.

    ex..

    i have set on

    10.00
    10.05

    and it runs on

    10.00.01
    10.05.01

    Please guide me how can i solve this problem.
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    The lowest interval for crontab is a minute ...

    You are seeing "1" second logged because that is the time it took
    for your script to start executing and that execution get logged.

    Your crons are actually firing off correctly based on what you quoted. :cool:
     
  3. map007

    map007 Active Member

    Joined:
    Jun 5, 2008
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hi Spiral,

    Thanks for your reply...

    Yes you are right but i want to that cron at fix time , it means 10.00.00 not on 10.00.01 so please guide me how can i do this....

    Thank you.
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    If it takes 1 second for your script to run, you need to run it 1 second early ...

    Subtract 1 minute from the scheduled running time ...

    Put in a "sleep 58" or "sleep 59" line in the top of your cron script
    to have it wait almost a full minute before continuing processing
    and you may have to play around with it a bit, but you may be
    able to time it such that your script finishes running at the
    exact time that you want.
     
Loading...

Share This Page