Cronjob script : retrieve the date of the last execution ?

Author Message

Damien Pobel

Wednesday 07 January 2009 5:14:19 am

hi,

I'm writing a cronjob script for the extension eZAWStats [1] to correct files generated by AWStats. To avoid to process all files at every execution, I need a way to remember the date of the last execution.

I see many ways of doing that :
1. add the timestamp in expiry.php using the eZExpiryHandler class
2. use my own file to store the last execution time using the eZPHPCreator class
3. store the timestamp in my own SQL table
4. store the timestamp in an existing table like ezsite_data or in ezoperation_memento using eZMementoOperation persistent object

What is the best practice in such case ?

[1] http://projects.ez.no/ezawstats

cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

André R.

Wednesday 07 January 2009 5:50:37 am

Alternative 5: Re-use code form updateviewcount.php (writing last log line to log file).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 16:02:45
Script start
Timing: Jan 18 2025 16:02:45
Module start 'layout'
Timing: Jan 18 2025 16:02:45
Module start 'content'
Timing: Jan 18 2025 16:02:45
Module end 'content'
Timing: Jan 18 2025 16:02:45
Script end

Main resources:

Total runtime0.0186 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.1563152.6563
Module start 'layout' 0.00700.0041 740.812539.4922
Module start 'content' 0.01110.0052 780.304789.3828
Module end 'content' 0.01630.0021 869.687534.3047
Script end 0.0185  903.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002915.5540140.0002
Check MTime0.00126.2470140.0001
Mysql Total
Database connection0.00105.659710.0010
Mysqli_queries0.004423.921530.0015
Looping result0.00000.096410.0000
Template Total0.00168.510.0016
Template load0.00094.888610.0009
Template processing0.00073.627910.0007
Override
Cache load0.00063.417210.0006
General
dbfile0.00031.526780.0000
String conversion0.00000.050140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs