如何在Ubuntu中使用Cronjob运行CodeIgniter PHP文件?
因此,我在codeigniter中具有此PHP功能路径,我试图通过Ubuntu中的Cron作业运行。但是无论我尝试过什么,它都无法正常工作。到目前为止,我尝试过的命令
* * * * * /usr/bin/php http://localhost/QAPIv2/updateTestData
,但没有执行。我正在使用Codeigniter
So i have this php function path in codeigniter which I am trying to run through cron job in ubuntu. But whatever I have tried it is not working. The command I have tried so far
* * * * * /usr/bin/php http://localhost/QAPIv2/updateTestData
But it is not executing. I am using codeigniter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要详细说明Rohan的答案,您可以运行诸如
php index.php控制器函数
之类的功能。因此,例如,要在每个星期二上午8:31运行您的脚本,您的crontab条目应该看起来像:To elaborate on Rohan's answer, you run the functions like
php index.php controller function
. So, for example, to run your script every Tuesday at 8:31AM, your crontab entry should look like :尝试以下操作:
第一个数字是cron.in功能名称的时间,您应该给要加载在Cron中的控制器函数名称。
Try this:
First number is time for cron.In function name you should give the controller function name which you want to load in cron.
请从命令行调用功能。
请根据您的代码更改控制器和功能。
Please call the function from the command line.
Please change the controller and function according to your code.