RUNNING CRON JOB FOR CODEIGNITER
Created by Bhavesh Gohil on Date: 16/12/2020
Addition of cron jobs in CodeIgniter application can provide additional usefullness. In this blog, You can see that how to run cron job in Codeigniter
STEPS TO CREATE CRON JOB FOR CODEIGNITER
Step 1: Create a simple controller:
<?php
class Demo_cron_ci extends CI_Controller{
public function__construct() {
parent::__ construct();
}
function demo_cron()
{
This code for demo purpose, you can replace it with your code.
$this->load->model('demo_cron_model');
$this-> demo_cron_model-> demo_cron();
}
}
?>
Step 2: Use this command for running cron job file: