Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set cron job php

How can i set a cron job programatically ,

we made a installer for our project and on the installation time i need to set a cron job programatically with PHP.

Please note that the project can be running on LINUX/WINDOWS ,

how can i achieve that ? or is there any better option than CRON JOB.

I am using Codeigniter(Native php based solutions are always welcome , but it will be very helpful if it is through CI)

THE cron job includes

  1. Check a particular table and remove invalid data
  2. Insert values to DB from mailServer
  3. Checking the availability of some files.

Thanks.

like image 760
Red Avatar asked Mar 06 '26 17:03

Red


1 Answers

Here is a nice article for managing your Cron jobs from PHP

http://net.tutsplus.com/tutorials/php/managing-cron-jobs-with-php-2/

this example contain full description of how to write a Cron job from PHP which is manageable from interface with complete source code.

like image 118
Pankaj Khairnar Avatar answered Mar 09 '26 07:03

Pankaj Khairnar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!