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.

cPanel cron jobs or cron.daily , cron.hourly , etc.?

Discussion in 'General Discussion' started by spaceman, Nov 3, 2003.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Hi All,

    Just refreshing my cron job knowledge here...

    /etc/cron.hourly/
    /etc/cron.daily
    /etc/cron.weekly/
    /etc/cron.monthly/

    Question 1.

    I am _presuming_ that if I move a script into /etc/cron.hourly/ then (assuming the script is error free, has the right permissions, etc.) then it'll run every hour, and so on and so forth for the other directories. So this would be a good place to throw jobs that need to run hourly, daily, weekly, etc. but that I'm not bothered about _when_ they run - the hourlies might run at any time day or night, but at the same time every day or night - correct?

    Question 2.

    Using cPanel I can tell a script (anywhere on the server, irrespective of the directory it's in) to run at any interval I choose, and at the time of my choosing. So I'm thinking that if I want more precise control over a cron job, use cPanel and put the script in whatever directory I want. If I'm not fussed when it runs, then throw it in /etc/cron.daily or whichever interval is appropriate. Yes?

    Thanks for your feedback.
     
  2. Ganga

    Ganga Well-Known Member

    Joined:
    Oct 2, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    This is a question I also need answer to, can somebody please reply and help us?

    Thanks!
     
  3. Ganga

    Ganga Well-Known Member

    Joined:
    Oct 2, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Please kindly reply.....

    Too many questions go unanswered in this forum... :(
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    I'll let you know in an hour.

    I stuck a simple script to email me in the cron.hourly directory. If that's how it works, I'll get an email within an hour.
     
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That's how it works. I just got an email from my script that I just stuck in the cron.hourly directory.

    Just stick a script in the appropriate directory, set it to executable, and it's ready to go.
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Correct
     
  7. Ganga

    Ganga Well-Known Member

    Joined:
    Oct 2, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Many thanks for the prompt answers!
     
Loading...

Share This Page