Skip to main content

user cron jobs not working

Comments

9 comments

  • Infopro
    Have you had a chance to review the docs for cron jobs? Cron Jobs - Version 56 Documentation - cPanel Documentation Note item #2: Specify the absolute path to the command that you wish to run. For example, if you wish to run the public_html/index.php file in your home directory, enter the following command:
    0
  • WorkinOnIt
    Thanks for your reply. Yes, I have read that. I can't get the cron to fire at all. I am not even getting any email notification or errors. var/log/cron simply shows - but I do not see any RUN myvps /usr/bin/crontab[14960]: (USER) LIST (USER) myvps /usr/bin/crontab[14961]: (USER) REPLACE (USER) myvps crond[1767]: (USER) RELOAD (/var/spool/cron/USER)
    0
  • WorkinOnIt
    System Crons are working - just not cron jobs set up through cPanel user
    0
  • cPanelMichael
    Hello, Could you verify which version of EasyApache is installed on this system? Also, do you receive a specific error message when manually running the command used in that cron via SSH in the jailed shell environment? Thank you.
    0
  • WorkinOnIt
    I am using Easy Apache 3 and no, there is no error. I've created a simple mail script in php and tested it from command line - it works fine. I then set up cron job to test and it also works fine. However, I am not receiving any email notifications from cron (success or failure messages). I've tried with two different users on the box. Here is the contents of var/spool/cron/user MAILTO="myemail@gmail.com[/EMAIL]" SHELL="/usr/local/cpanel/bin/jailshell" */5 * * * * wget http://mydomain.com/test.php Resolving mydomain.com... 123.456.78.9 Connecting to mydomain.com|123.456.78.9|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 0 [text/html] Saving to: "test.php" 0K 0.00 =0s
    I then modified the cron file path to create an error to test cron notification output: wget
    0
  • WorkinOnIt
    Further to the above, there are no failures mentiones in var/log/exim_mainlog and nothing in var/log/cron - infact I've grep'd all logs and can find no entries relating to the user cpanel cron jobs. However, I know the cron jobs are working as I've tested successfully as mentioned previously - just no emails and nothing in logs! The user is currently disabled shell - I will try with jailed and normal shell to see if that makes any difference Very strange.
    0
  • WorkinOnIt
    I am now convinced this issue is to do with RESTRICT_SYSLOG in CSF - I have this set to 3 (default) but I understand this breaks cron logging. I've searched google and read through multiple CSF docs but have been unable to find a way to mitigate the lack of logging for user crons. [edit - I disabled CSF and that hasn't changed anything - sadly] Some advice would be appreciated!
    0
  • WorkinOnIt
    Thanks to cPanel support, I was able to resolve this by setting RESTRICT_SYSLOG in CSF to "2" and also not logging to the test.log file. This is really not a permanent solution so I will follow up with CSF forum.
    0
  • cPanelMichael
    Thanks to cPanel support, I was able to resolve this by setting RESTRICT_SYSLOG in CSF to "2" and also not logging to the test.log file.

    I'm happy to see the issue is now resolved. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.