Help - Search - Members - Calendar
Full Version: Crons not working
The Planet Forums > Control Panels > cPanel/WHM
Brandon Rohde
Hello,

I have setup some crons in cPanel, and none of them seem to be executing. I have looked in the /var/spool/cron dir and opened up the cron file for my user, and it shows the following:

MAILTO="brandon@mydomain.com"
30 * * * * /usr/local/bin/php -q /home/myuser/public_html/crons/renew_advertising_notice.php
30 5 * * * GET http://www.mydomain.com/crons/renew_membership_notice.php > /dev/null
15 * * * * GET http://www.mydomain.com/crons/purge_active_guest_users.php > /dev/null


This all seems to look correct. If I execute one of the lines alone, such as:
GET http://www.mydomain.com/crons/purge_active_guest_users.php > /dev/null

Then the script runs perfect, so I know there isnt an error in the code. Any ideas on why they are not running?

Thanks in advance!
markcausa
I had the same exact problem so I ran /scripts/upcp and it was fixed.

Maybe you are a victim of the same release problem I had.
Brandon Rohde
Thanks for the suggestion. I tried that, and still no luck though. I update the CP regularily, and the crons have not worked since I got the server. I never had a major need for them before since I was only hosting some small sites on this server, however now I am moving a bigger site to this box and I need to run some daily cleanup scripts to clear database records. Any other ideas or possibilities on what the problem may be?
James Jhurani
QUOTE (Brandon Rohde @ Mar 23 2007, 09:41 AM) *
Thanks for the suggestion. I tried that, and still no luck though. I update the CP regularily, and the crons have not worked since I got the server. I never had a major need for them before since I was only hosting some small sites on this server, however now I am moving a bigger site to this box and I need to run some daily cleanup scripts to clear database records. Any other ideas or possibilities on what the problem may be?


I believe this issue was fixed by using the full path to GET (/usr/bin/GET) and restarting crond.
Panther13
I'm having a similar issue however it is only affecting one of my user accounts. I have scripts setup that automatically delete the spam boxes that spam assassin creates on a daily basis. The scripts are working fine for all but one of the accounts that are using these scripts. Any help to get me on track to fixing this issue would be appreciated!
James Jhurani
does the cron(/var/log/cron.log) log say anything like permission denied? Also try su'ing to that user with "su -l username" and execute the command.
Panther13
There are not any permission denied entries in the cron.log file. However, I was unable to su to that user... I received the following error:

Your account has expired; please contact your system administrator

I also found this comment in my LogWatch file:

CODE
--------------------- pam_unix Begin ------------------------

crond:
   Unknown Entries:
      account <useraccount> has expired (failed to change password): 1 Time(s)


---------------------- pam_unix End -------------------------


So, it looks to me like it has something to do with the fact that cPanel thinks that the account has expired.
James Jhurani
I'm not sure how expiration is actually done... I've never encountered that before. Try changing the users password...

from command like simply type as root "passwd <username>", obviously replacing <username> with the username. It will then ask you for a new password.
Panther13
It appears that changing the password solved the problem. I checked my cron.log this morning and the scripts for the problem account ran at the specified time. Thanks for your assistance James! smile.gif
James Erickson
You might want to check /etc/login.defs for the PASS_MAX_DAYS entry. This specifies how long a password can go before it 'expires'.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.