runcronjobs with args for script

Author Message

Vincent DELHAYE

Tuesday 24 October 2006 7:58:44 am

Hello,
I need to execute some script by cronjobs with option.
Example :
/usr/local/php/bin/php -C /var/www/atousantevd/runcronjobs.php alerte for_day
/usr/local/php/bin/php -C /var/www/atousantevd/runcronjobs.php alerte for_month

But I don't see how to get my option 'for_day' in my script 'alerte.php'.

Somebody has already done it ?

thx

Kristof Coomans

Tuesday 24 October 2006 9:15:54 am

Hello Vincent

As far as I know you can not specify any custom options for cron scripts. Use a normal CLI script instead, by using the eZCLI and eZScript classes. runcronjobs.php is in fact such a CLI script. There are some other good examples in the bin/php directory.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Piotr Switkowski

Wednesday 25 October 2006 5:42:24 am

Hello

I need to do the same thing. I am thinking about the following logic:
- create script that have all logic depending on your parameter var
- create script that sets the value of your parameter to "for_day" and then includes script with login
- create script as in previous point, but setting parameter to 'for_month'

Instead of passing the parameter you wpuld simply need to call right script, but all logic will be written only once.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:17:24
Script start
Timing: Jan 18 2025 15:17:24
Module start 'layout'
Timing: Jan 18 2025 15:17:24
Module start 'content'
Timing: Jan 18 2025 15:17:25
Module end 'content'
Timing: Jan 18 2025 15:17:25
Script end

Main resources:

Total runtime1.1126 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.0547152.6250
Module start 'layout' 0.00480.0028 741.679739.4453
Module start 'content' 0.00771.1034 781.1250565.9766
Module end 'content' 1.11100.0015 1,347.101612.1563
Script end 1.1125  1,359.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2740160.0002
Check MTime0.00140.1235160.0001
Mysql Total
Database connection0.00100.092810.0010
Mysqli_queries1.069896.1583590.0181
Looping result0.00050.0408570.0000
Template Total1.079797.020.5399
Template load0.00210.192620.0011
Template processing1.077596.853520.5388
Template load and register function0.00010.009110.0001
states
state_id_array0.00140.128010.0014
state_identifier_array0.00130.121220.0007
Override
Cache load0.00180.1585220.0001
Sytem overhead
Fetch class attribute can translate value0.00050.041830.0002
Fetch class attribute name0.00090.078540.0002
XML
Image XML parsing0.00060.057730.0002
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00080.0701160.0000
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs