如何在PHP CodeIgniter中创建Cron作业 [英] How to create a Cron job in PHP CodeIgniter

查看:70
本文介绍了如何在PHP CodeIgniter中创建Cron作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过使用CodeIgniter中的Cron作业来运行查询。如何使用下面提到的详细信息(每周,7周,重复和按时间)创建Cron作业。在这里,我附上了屏幕截图供您参考。

I need to run a query by using Cron job in CodeIgniter. How to create a Cron job with below mentioned details(weekly, 7 weeks, repeat on, and time). Here I attached the screenshot for your reference.

请对此提出建议。

谢谢!

推荐答案

触发cron作业。


  • 您应该在控制器中编写一个函数来执行所需的操作(发送通知/在此处执行任何操作。 )。

  • 您应确保您的控制器功能没有与此会话相关的任何会话。

我添加了以下图像,请参考它们

I have added following images , refer them

我添加了一个每天运行一次的cron。

I have added a cron which runs once in a day. and in your server, it looks like this.

这篇关于如何在PHP CodeIgniter中创建Cron作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆