Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 trying to execute a PHP script every two minutes on my server, but it doesn't seem to be working.

I'm using the following cron job:

2 * * * * /usr/bin/php /srv/www/<snip>/<snip>/run.php

I also tried:

2 * * * * php /srv/www/<snip>/<snip>/run.php

Both of which execute properly via the SSH command line.

I entered the cron job in with the following method via SSH:

crontab -e

I'm also running Ubuntu 10.04.3 LTS if that matters.

Is there something I'm doing wrong? any advice?

share|improve this question
up vote 5 down vote accepted

You wrote 2 in the minute column, so the job runs at 2 minutes past the hour, every hour. To run the job every 2 minutes, write

*/2 * * * * php /srv/www/<snip>/<snip>/run.php
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.