WorkinOnIt

Well-Known Member
Aug 3, 2016
302
53
78
UK
cPanel Access Level
Root Administrator
I'm running cpanel 58.0.24

I can add cron jobs under root or user in cPanel but they are not firing.

2 * * * * wget -q -O - http://mydomain.com/wp-cron.php?doing_wp_cron >> /tmp/test.log 2>&1

Produces the following in var/log/cron

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)

Permissions are 755 on usr/bin/crontab

# crontab -l does not show the crons


Any suggestions?
 

WorkinOnIt

Well-Known Member
Aug 3, 2016
302
53
78
UK
cPanel Access Level
Root Administrator
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)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.
 

WorkinOnIt

Well-Known Member
Aug 3, 2016
302
53
78
UK
cPanel Access Level
Root Administrator
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="[email protected]"
SHELL="/usr/local/cpanel/bin/jailshell"
*/5 * * * * wget http://www.mydomain.com/test.php >> /tmp/test-cron.log 2>&1
The test-cron.log on success shows this:

--2016-09-01 11:45:01-- 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 http://www.mydomain.com/nothinghere.php

and in the test-cron.log I see the error (404 not found) but still no email notification is sent to the user email address as specified on the cPanel > Cron Email (and nothing to root either)

Thanks
 

WorkinOnIt

Well-Known Member
Aug 3, 2016
302
53
78
UK
cPanel Access Level
Root Administrator
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.
 
Last edited:

WorkinOnIt

Well-Known Member
Aug 3, 2016
302
53
78
UK
cPanel Access Level
Root Administrator
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!
 
Last edited:

WorkinOnIt

Well-Known Member
Aug 3, 2016
302
53
78
UK
cPanel Access Level
Root Administrator
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.