Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble making cron work.

I edit my cron jobs doing

  1. sudo crontab -u myuser -e

  2. sudo crontab -u myuser -l prompts my cron tables:

    */1 * * * * /home/myuser/Projects/scripts/
  3. /usr/lib/cron/cron.allow and .deny do not exist

  4. ps -A | grep cron && ps aux | grep 'cron' -n

    820 ?        00:00:00 cron
    63:root       820  0.0  0.0   2268   884 ?        Ss   17:09   0:00 cron

Yet the script is not executed. Am I missing something?

After the crontab -e it shows that it is saving to a temporary file. Is this a problem?

share|improve this question
Is your script executable by "myuser"? – Chris Ting Jun 7 '11 at 21:47
It is (chmod 755) – Fisher Jun 7 '11 at 21:49
After all it is running. Changed the output directory of my test script and it is working. However, how can i run it with root priviligies? Should i just edit the root crontab by doing sudo crontab -e ? – Fisher Jun 7 '11 at 21:56
There are a few ways to get your script running with root privs. Using the root crontab is the easiest and most straight-forward. – Chris Ting Jun 7 '11 at 22:01

Cron check the crontabs every minute to look for changes, create your cron entry and be more patient. crontab's are saved in temporary file until they're read.

Why you're using sudo to modify crontab for another user? User without shell? Seems strange to execute an script in that environment.

My answer is basead in vixie's cron, always put version and branch of the software in that type of question.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .