Using crontab in Ubuntu to execute php code wangking writes that in website development, php code will inevitably be executed on a regular basis. php does not have a timer like java, so it can only be replaced by crontab .??? Edit the crontab file to view the specific writing specifications. it is very convenient (vimetccrontab ):???? The writing rules are as follows: # execute php code using crontab in mhdommondowuserc Ubuntu
Wangking wrote:
In website development, it is inevitable that php code will be executed regularly. php does not have a timer like java, so it can only be replaced by crontab.
?
? ? Edit the crontab file to view the specific writing specifications (Vim/etc/crontab):
?
? ? ? The writing rules are as follows:
# m h dom mon dow user command17 * * * * root cd / && run-parts --report /etc/cron.hourly25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )#
?
? ? Then I need to execute my php code every minute, which can be written as follows:
? ??
*/1 * * * * root wget -q -O /dev/null http://www.rewufeng.com/
?
? ? The daily php code execution is:
59 23 * * * root wget -q -O /dev/null http://www.rewufeng.com/
?
? ? For more information about crontab, see: http://hi.baidu.com/michaelxdt/item/a8e4fec22a59867388ad9e62.
?
? ? Complete.
?
?