Proper Cron Jobs

Permalink
Hi

Is there anyway to run Cron jobs properly in C5?

Invoke them from the command line rather than via curl, I run Varnish and running to curl to do Cron jobs just is not an option.

Thanks

yolk
 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
If you can run PHP from the command-line, you could probably create a script that loads the C5 environment and then copy/paste the contents of the C5 "tools" file that runs the job (maybe convert the $_GET arguments to command line parameters, and possibly make some other changes?).

Maybe this addon will work for you:
http://www.concrete5.org/marketplace/addons/nontab-scheduler/...

If not, I think you'll need to create a PHP command line script -- piece together the functionality from /concrete/dispatcher.php and /concrete/tools/jobs.php (and change the $_GET stuff to command-line parameters). If you go this route, it might be helpful to see how the command-line installer does its thing:
https://github.com/concrete5/concrete5-cli/blob/master/install-concr...
yolk replied on at Permalink Reply
yolk
Thanks Jordan. Useful as ever!

I was afraid this might be the case, just wondered if there was something in place already.

But the CLI installer is a good place to start.

Thanks.