Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have a python script on my desktop: /home/ceasor/Desktop/

In /etc/crontab, I wrote:

0 */2   * * *   ceasor    sudo python  /home/ceasor/Desktop/

The python script is not getting run. How do I run cron every 10 minutes?

share|improve this question

migrated from Mar 16 '11 at 20:40

This question came from our site for professional and enthusiast programmers.

Why do you call sudo python? If you want to run it as root, just specify that user in your crontab. Also 0 */2 means every 2 hours, not every 10 minutes. – Joachim Sauer Mar 15 '11 at 13:57
It's on your Desktop? Then you have the wrong path in your crontab – Ocaso Protal Mar 15 '11 at 13:57
can your account run sudo w/o a password? IS python in the path that cron sees?. also that crontab says ever 2 hours. if you want every 10 minutes use */10 * * * * – Doon Mar 15 '11 at 13:58

Run a command every 10 minutes:

*/10 * * * *   ceasor    sudo python  /home/ceasor/

The */10 token will fire the cronjob every 10th minute.

You could also enumerate every minute that you want it to fire off:

0,10,20,30,40,50 * * * * sudo python /home/ceasor/Desktop/
share|improve this answer

For every ten minutes you need

  */10 * * * *     ceasor         sudo python /home/ceasor/Desktop/

and if the script is in Desktop/ you need to use that path as in my example here.

share|improve this answer

To run something every ten minutes, I normally put something like the following in my crontab:

0,10,20,30,40,50 * * * * sudo python /home/ceasor/Desktop/

Adjust the 0,10,20,... as you need to hit the minutes of the hour you want.

share|improve this answer
you can use */10 instead of the enumeration, it means every 10 minutes – krtek Mar 15 '11 at 14:02
@Krtek: Yes, that's been stated in other answers. Both ways works, and I thought it would be good to make the OP aware of alternatives. – GreenMatt Mar 15 '11 at 14:07

Your line means runs at 0 minutes every two hours (ie 00:00, 02:00, 04:00, etc).

If you want to run something every 10 minutes :

*/10 * * * *  ceasor    sudo python  /home/ceasor/Desktop/

I took the liberty to correct the wrong path.

FYI, these are the meaning of the values :

         field          allowed values
          -----          --------------
          minute         0-59
          hour           0-23
          day of month   1-31
          month          1-12 (or names, see below)
          day of week    0-7 (0 or 7 is Sun, or use names)
          username       any user from the system
          command        the command you want to run

And if you want to run something as root, you should put root instead of ceasor for the username and drop the sudo.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.