eZ Community » Forums » Developer » Cronjob arguments
expandshrink

Cronjob arguments

Cronjob arguments

Friday 09 January 2015 2:55:08 pm - 1 reply

Hi everyone, 

I have a cronjob which is launched every 15 minutes. But this cronjob can be launched manually with arguments.

How can I write the command line in order to include arguments used by the script ?

For example : php runcronjobs.php script arg1 arg2 ?

Thanks for your help

Saturday 10 January 2015 9:43:06 am

Hello Jerome,

I'm sorry to say that cronjob part scripts in eZ Publish do not support command line arguments.

What you need to do is re-implement your eZ Publish cronjob part script into an eZ Publish cli script which does support command line arguments.

I've done this several times myself with no pain as you can do this within minutes reusing 98% of the same script code (instantiation code at the top is the only thing different).

In fact often I create cronjobs which call cli scripts to reduce time to implement and increase flexibility.

https://github.com/brookinsconsul.../cronjobs/bcimagealiasregenerate.php

https://github.com/brookinsconsul...blob/master/bin/php/bcimagealias.php

I hope this helps!

Cheers,
Heath

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from