Jump to content

Adding to the crontab isn't working


_guitar

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/196740-adding-to-the-crontab-isnt-working/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.