开发者

Creating a cron job in php

开发者 https://www.devze.com 2022-12-15 07:09 出处:网络
I want to create a cron job which has to 开发者_开发知识库execute a file every 30 minutes or regular interval. I don\'t have a cpanel or any front-end to do that.

I want to create a cron job which has to 开发者_开发知识库execute a file every 30 minutes or regular interval. I don't have a cpanel or any front-end to do that.

How do I do it?


You can't. This is an OS level function not PHP level. Best bet is to email your host and ask them if it's possible to setup a cron for you.


If the user as whom the webserver runs is allowed to have cron jobs, and the system is correcty set up, then its simply a matter of executing the cron program (popen, exec, system....etc) and feeding it an appropirate input file. However on any sensibly configured, internet connected webserver, the httpd user will NOT be allowed to run cron jobs.

There are tools like pseudocron but be careful.

C.


Psuedocron may help.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号