Shawon Md
Shawon Md

Reputation: 315

command in cron to run php every certain mins

this might be a repeat.
i would like to run my index.php every certain mins. My server has option run cron command/ cron jobs. Someone please tell me what could should I use to schedule.
Thanks in advance.

Upvotes: 0

Views: 103

Answers (3)

Rosmarine Popcorn
Rosmarine Popcorn

Reputation: 10965

You could use this command

Minutes Hours  Day  Month WeekDay
45      *      *    *     *        php /path/to/index.php *

Here is an article about a php cron manager

Upvotes: 1

Ron
Ron

Reputation: 1336

First, here is how cron works:

http://en.wikipedia.org/wiki/Cron

Then, the comand should look like this:

* * * * * cd /directory/of/the/script/ && php scriptname.php >> /directory/of/the/logfile.log

Upvotes: 0

Explosion Pills
Explosion Pills

Reputation: 191819

First of all, why?

Second, crontab -e will allow you to edit your crontab. Then it's just as easy as

? * * * * php /path/to/index.php

Upvotes: 1

Related Questions