简体   繁体   中英

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.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM