Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 4 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

 
discard

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.