title: How to set up a cron job with codeigniter
body: <p>I am trying to set up a cron job using COdeigniter but I cannot figure out how to get it to work. I have a file called email_check.php in my controllers folder, and I have added a .cron file to the servers cron folder, which contains the following</p>
  
  <p>email_check.cron</p>
  
  <pre><code>*/1 * * * * php /var/www/html/application/controllers/email_check
  </code></pre>
  
  <p>email_check.php</p>
  
  <pre><code>class Email_check extends CI_Controller {
  
      function __construct()
      {
          parent::__construct();
          $this-&gt;index();
      }
  
      function index()
      {
          $this-&gt;load-&gt;model('admin/info_model'); 
          $this-&gt;info_model-&gt;addTestData();
      }
  
  }
  </code></pre>
  
  <p>The addTestData adds a new row into a database table. I would like this to run every minute, however it isn't working at all and I have no idea why.</p>
  
  <p>Maybe it may be the paths that are wrong. Do I need to point the php part to the php.exe in the server.</p>
  
  <p>If anyone could help or point me in the right direction it would be greatly appreciated!</p>