CRON job for codeigniter

后端 未结 4 698
独厮守ぢ
独厮守ぢ 2020-12-30 11:48

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

相关标签:
4条回答
  • 2020-12-30 12:18

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

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

    0 讨论(0)
  • 2020-12-30 12:25

    My hosting site is godaddy which give the option to create a cron. All we need to do is write a plainphp page to do the job, with sql connection and all stuff and just upload to the godaddy server and create the cron. Thats it. Job is easier.

    0 讨论(0)
  • 2020-12-30 12:30

    If you are looking on how to create cron job, then have a look at this:

    http://www.unixgeeks.org/security/newbie/unix/cron-1.html

    But if you mean how to put expired users into another table, then you should show your table structure.

    0 讨论(0)
  • 2020-12-30 12:38

    This might not be what you're looking for, but it works just fine for me:

    Create your CRON job logic as a 'normal' controller function.

    Then, in your standard, non-CI, PHP cronjob file just load the URL via

    file_get_contents('http:example.com/cronjob/');
    

    This will treat the URL as being hit just as by any other user and the entire CI framework will be at your disposal.

    0 讨论(0)
提交回复
热议问题