CodeIgniter Forums
how to use php to schedule a task under codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forum-7.html)
+--- Forum: Addins (https://forum.codeigniter.com/forum-13.html)
+--- Thread: how to use php to schedule a task under codeigniter (/thread-74278.html)



how to use php to schedule a task under codeigniter - pamgre - 09-05-2019

I am looking for some time to write a php script (cron) that allows to periodically run another script but I do not know how to do it! I'm asking for your help. Thank you



RE: how to use php to schedule a task under codeigniter - jameslittle - 09-05-2019

A true cron is something that runs at the server OS level. There are various ways to schedule them using browser tools like CPanel, and it's worth mentioning that CMSs like Wordpress and Drupal have "poor man's cron" tools that kick off scripts triggered by a user request.

The cron can call a file/script anywhere on your server and execute it with PHP... or it can trigger a full URL like a CodeIgniter path.

There's a good tutorial here:
https://linux4one.com/how-to-set-cron-jobs-on-ubuntu-18-04/


RE: how to use php to schedule a task under codeigniter - includebeer - 09-08-2019

For a cron job you can call your CI script from the command line: https://codeigniter.com/user_guide/general/cli.html


RE: how to use php to schedule a task under codeigniter - php_rocs - 09-08-2019

@pamgre,

Have you checked github or you could try these links...
https://libraries.io/search?keywords=crontab&languages=PHP
https://packagist.org/?query=crontab