_guitar Posted March 28, 2010 Share Posted March 28, 2010 It works on my testing server but not my dedicated server, they both run CentOS. The servers run Apache and PHP and I'm trying to add cron jobs to the current user's crontab with PHP. I place all jobs in a text file (cron.txt) and then load that into the crontab program, like this: crontab -u username cron.txt Then I call: crontab -u username -l to list the current jobs and it shows nothing. Username is the name of the user that PHP runs under. I removed it from the cron.deny file and added it to the cron.allow file, to no avail. Anyone know about other possibilities that could cause this not to work? Quote Link to comment https://forums.phpfreaks.com/topic/196740-adding-to-the-crontab-isnt-working/ Share on other sites More sharing options...
gamblor01 Posted March 28, 2010 Share Posted March 28, 2010 Is crond running? I'm not very familiar with CentOS (never used it myself) but it's supposed to be built from the Redhat source code right? Verify that you have the appropriate rpm installed: $ rpm -qa | grep -i cron Apparently you need the vixie-cron package installed. Then make sure that crond is running: $ service crond start You can also check ps output or use service to see if crond is running. Also try running crontab -e and make sure that the commands you put in there are shown. Quote Link to comment https://forums.phpfreaks.com/topic/196740-adding-to-the-crontab-isnt-working/#findComment-1033035 Share on other sites More sharing options...
_guitar Posted March 29, 2010 Author Share Posted March 29, 2010 Thanks, gamblor01. Apparently, CentOS doesn't like when you specify the username in the command using the -u parameter. Removing that part entirely makes it work. Quote Link to comment https://forums.phpfreaks.com/topic/196740-adding-to-the-crontab-isnt-working/#findComment-1033770 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.