junglecat

Well-Known Member
Jul 6, 2004
168
0
166
WHM 10.8.0 cPanel 10.9.0-R57
CentOS 3.8 i686 - WHM X v3.1.0

I have support tickets today from users who's crons have stopped running the scripts in their accounts. I went into one of the user's cpanels and changed the email address where the cron output will be sent to my own email address so that I can see if there are any errors in the cron mails, but I'm not receiving any cron emails. I should be receiving them every 10 minutes from that one user account.

How can I troubleshoot this? :confused:
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,217
4
193
Minneapolis, MN
I have support tickets today from users who's crons have stopped running the scripts in their accounts.
Restart cron daemon:
/sbin/service crond restart
If that doesn't help, check the cron log file for any errors:
/var/log/cron
 

junglecat

Well-Known Member
Jul 6, 2004
168
0
166
Just did that, got this:

/sbin/service crond restart
Stopping crond: cannot stop crond: crond is not running. [FAILED]
Starting crond: [ OK ]


Which indicates crons weren't running and have restarted, so that may have fixed it. I will know in a few minutes.

Thanks! (I'll come back and update the topic if they still aren't running).
 

junglecat

Well-Known Member
Jul 6, 2004
168
0
166
I'm still having a problem. I restart crons, they run for a few hours, or a day or so, and then fail again.

I tried this:
/var/log/cron

and got:
bash: /var/log/cron: Permission denied

Any suggestions?
 

sjackson909

Well-Known Member
Jun 8, 2004
113
0
166
Columbus, OH
Make sure it's running

ps -ax | grep cron

You will see crond if it's running. Also /var/log/cron is a log file. You will need to open it or tail it.

tail /var/log/cron

What dist are you using?
 

junglecat

Well-Known Member
Jul 6, 2004
168
0
166
I should have mentioned that I generally need idiot instructions :p

Here is the output:

[email protected] [/home/cathy]# ps -ax | grep cron
4756 ? S 0:00 crond
7380 pts/0 S 0:00 grep cron
[email protected] [/home/cathy]# tail /var/log/cron
Nov 22 10:50:02 server6 crond[5688]: (paidcash) CMD (/usr/bin/php /home/paidcash
/public_html/scripts/admin/cronjobs.php > /dev/null)
Nov 22 10:50:02 server6 crond[5689]: (buzz411) CMD (lynx --dump http://411buzz.c
om/pages/ptp_proxy_guard_live.php > /dev/null)
Nov 22 10:50:02 server6 crond[5683]: (buzz411) CMD (lynx --dump http://411buzz.c
om/scripts/admin/jkcron.php > /dev/null)
Nov 22 10:50:02 server6 crond[5665]: (skyesear) CMD (/usr/bin/php /home/skyesear
/public_html/cron.php)
Nov 22 10:51:01 server6 crond[6198]: (skyesear) CMD (/usr/bin/php /home/skyesear
/public_html/cron.php)
Nov 22 10:51:01 server6 crond[6199]: (paidcash) CMD (/usr/bin/php /home/paidcash
/public_html/scripts/admin/cronjobs.php > /dev/null)
Nov 22 10:52:02 server6 crond[6701]: (skyesear) CMD (/usr/bin/php /home/skyesear
/public_html/cron.php)
Nov 22 10:52:02 server6 crond[6702]: (paidcash) CMD (/usr/bin/php /home/paidcash
/public_html/scripts/admin/cronjobs.php > /dev/null)
Nov 22 10:53:01 server6 crond[7223]: (skyesear) CMD (/usr/bin/php /home/skyesear
/public_html/cron.php)
Nov 22 10:53:01 server6 crond[7225]: (paidcash) CMD (/usr/bin/php /home/paidcash
/public_html/scripts/admin/cronjobs.php > /dev/null)


Then I did grep again and got this :confused:

[email protected] [/home/cathy]# [email protected] [/home/cathy]# ps -ax | grep cron
bash: [email protected]: command not found
[email protected] [/home/cathy]# 4756 ? S 0:00 crond
bash: 4756: command not found
[email protected] [/home/cathy]# 7380 pts/0 S 0:00 grep cron
bash: 7380: command not found
[email protected] [/home/cathy]# [email protected] [/home/cathy]# tail /var/log/cron
bash: [email protected]: command not found
[email protected] [/home/cathy]# Nov 22 10:50:02 server6 crond[5688]: (paidcash) CMD (/usr/bin/php /home/paidcash
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/scripts/admin/cronjobs.php > /dev/null)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:50:02 server6 crond[5689]: (buzz411) CMD (lynx --dump http://411buzz.c
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# om/pages/ptp_proxy_guard_live.php > /dev/null)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:50:02 server6 crond[5683]: (buzz411) CMD (lynx --dump http://411buzz.c
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# om/scripts/admin/jkcron.php > /dev/null)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:50:02 server6 crond[5665]: (skyesear) CMD (/usr/bin/php /home/skyesear
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/cron.php)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:51:01 server6 crond[6198]: (skyesear) CMD (/usr/bin/php /home/skyesear
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/cron.php)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:51:01 server6 crond[6199]: (paidcash) CMD (/usr/bin/php /home/paidcash
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/scripts/admin/cronjobs.php > /dev/null)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:52:02 server6 crond[6701]: (skyesear) CMD (/usr/bin/php /home/skyesear
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/cron.php)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:52:02 server6 crond[6702]: (paidcash) CMD (/usr/bin/php /home/paidcash
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/scripts/admin/cronjobs.php > /dev/null)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:53:01 server6 crond[7223]: (skyesear) CMD (/usr/bin/php /home/skyesear
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/cron.php)
bash: syntax error near unexpected token `)'
[email protected] [/home/cathy]# Nov 22 10:53:01 server6 crond[7225]: (paidcash) CMD (/usr/bin/php /home/paidcash
bash: syntax error near unexpected token `('
[email protected] [/home/cathy]# /public_html/scripts/admin/cronjobs.php > /dev/null)
bash: syntax error near unexpected token `)'
 

sjackson909

Well-Known Member
Jun 8, 2004
113
0
166
Columbus, OH
Ok. Good crond is running. Which user is having problems? Do you see them in the tail /var/log/cron? Also how do you know they are having problems and what is the problem they are having?
 

TimTim

Registered
Jan 14, 2005
4
0
151
Try modify the crontab to to be "/usr/bin/php -f /home/paidcash
/public_html/scripts/admin/cronjobs.php" (minus quotes of course)
 

junglecat

Well-Known Member
Jul 6, 2004
168
0
166
Ok. Good crond is running. Which user is having problems? Do you see them in the tail /var/log/cron? Also how do you know they are having problems and what is the problem they are having?
Several users are complaining. They are running the Cash Crusader affiliate script. I'm a reseller for that script and I know it inside and out. It uses crons. When the crons stop, the script stops updating user info and also when you login to admin while crons aren't running you get a warning that crons aren't running.

But that's not the only script using crons. A user on that server is running a search script which also uses crons, and her script stops working, too.

The problem is, the crons run for a few hours to a day or so, and then stop. I have to restart it. When I restart it, I get this:

Stopping crond: cannot stop crond: crond is not running. [FAILED]
Starting crond: [ OK ]

So obviously, it is indeed failing since I get the error that it's not running.

When I restart it, the sites start working again for a few hours until crons fail again.