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.

Account cron jobs does not work

Discussion in 'General Discussion' started by OooLong, May 26, 2015.

  1. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I'm testing to put some cron task in an account Cron Jobs, however this doesn't appear to be working. I tried several different cron task and none are doing what its supposed to. How do I go about fixing this? Thanks in advance.

    ps: doing crontab -e from root there work fine but not from cPanel individual account Cron Jobs page. I still need this working. Thanks.
     
    #1 OooLong, May 26, 2015
    Last edited: May 26, 2015
  2. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you set an email address to send any output from the cron to?

    It's possible it's running but a fatal error in the respective scripts are killing it and making it seem like its not running?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Have you tried running the cron jobs manually to ensure they work properly? Is the "crond" service running (e.g. "service crond restart" reports "OK")?

    Thank you.
     
  4. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Yep I have the exact same cron jobs but writing to another file from root using crontab -e, that one work swell. Putting it in account cron jobs however does nothing. Is crontab -e and account cron jobs using different services?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Michael,

    Hm it could be I tried to run a command outside of its own account jail. I just tried something local with this execute file in:

    /twodata/atomict/ctest/testcreatedir

    testcreatedir:
    mkdir a b c

    * * * * * /twodata/atomict/ctest/testcreatedir

    Now I get an email from cron jobs:
    mkdir: cannot create directory `a': File exists
    mkdir: cannot create directory `b': File exists
    mkdir: cannot create directory `c': File exists

    I test the command out in root and the script ran fine creating the dir as it supposed to. Why does cron not work here?

    ps: forgot to add the directory ctest is wipe clean except for the testcreatedir script
     
  7. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I figure out why now, the directory is created in /root or root of the account and not where the script is ran. So the cronjobs does work. Thanks.
     
  8. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    Glad to hear that this issue is now resolved!
     
Loading...

Share This Page