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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.