php运行cronjobs [英] Php run cronjobs
问题描述
我如何从php运行cron作业,而cron在那一刻启动?
我有一个站点地图脚本,我想转到站点地图链接,而不必等待他去做他的工作,而是发送信息给我的求职号Sitemap。
How can i run an cron job from php, and the cron to start in that moment? I have a sitemap script, and i want to turn to a sitemap link, without waiting for him to do his job, to send information to call my job horn Sitemap.
抱歉,我的英语
推荐答案
需要在 cron计划中输入cron作业才能在特定的时间运行
A cron job needs to be entered into the "cron" schedule to run at a particular time.
我的猜测是您的安装中通常有一个脚本由cron启动,并且您希望在php程序检测到某种情况时启动该脚本。
My guess is that there is a script in your installation which is normally started by cron and you want to start it when your php program detects some condition.
您需要找出crontab脚本的位置(尝试使用 crontab -e获取当前定义的cron作业的列表),然后使用php system()启动它或exec()命令。
You need to find out where the crontab script is located (try "crontab -e" for a list of currently defineded cron jobs) and start it uing a php system() or exec() command.
这篇关于php运行cronjobs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!