Codeigniter 的 CRON 作业 [英] CRON job for codeigniter

查看:22
本文介绍了Codeigniter 的 CRON 作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 codeigniter.我想知道如何设置 cron 作业来检查表中是否有过期用户,并将数据插入到另一个表中,其中包含过期用户列表.如何做到这一点.

I am using codeigniter. I want to know how to set up a cron job to check a table for expiring users and insert data in to another table with the list of expiring users. How to do that.

当我尝试使用控制器和模型编写脚本以插入表格时:

When i tried to write a script with controller and model to insert the table:

致命错误:在 /home/content/html/test/live/application/controllers/cron.php 在线 中找不到控制器"类2

Fatal error: Class 'Controller' not found in /home/content/html/test/live/application/controllers/cron.php on line 2

推荐答案

您可以在此处找到有关使 CodeIgniter CLI 可访问的更多信息:http://phpstarter.net/2008/12/run-codeigniter-from-the-command-line-ssh/

You can find some more information on making CodeIgniter CLI-accessible here: http://phpstarter.net/2008/12/run-codeigniter-from-the-command-line-ssh/

下一步只需使用 crontab -e 来设置 cronjob.

Next step is just using crontab -e to set up the cronjob.

这篇关于Codeigniter 的 CRON 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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