Forums / General / Running crontabs

Running crontabs

Author Message

cliffp pratt

Thursday 22 April 2010 4:54:21 pm

I'm upgrading to 4.2 from 3.8. I'm trying to move some custom crontabs and I can't get them to run!

I've created a settings/override/crontab.ini.append.php, created a directory within extensions and moved the script there. I've then tried to run runcrontabs.php from the command line and get the following:

myserver>>: /sysmanage/data/www/ezpublish-4.2.0# $PHPCLI runcronjobs.php -dall exportcsv
Running cronjob part 'exportcsv'
#################################### DEBUG ####################################
Debug: (eZMySQLDB::query(0.000 ms) query number per page:0)
SET NAMES 'utf8'
No timing points defined
Peak memory usage: 6,120.4297 KB
Group ini_load:
Load cache: 0.0047 sec (7.7304%), 0.0012 avg sec (4)
FindInputFiles: 0.0016 sec (2.6515%), 0.0004 avg sec (4)
Group Mysql Total:
Mysql_queries: 0.0007 sec (1.1935%), 0.0002 avg sec (3)
Total script time: 0.0603 sec

If I run the command with an invalid name for the override section it complains:

Notice: No scripts found for execution.

If I put an invalid script name in the crontab.ini.append.php it runs with no messages.

So from the above it appears to be finding the override files, but for some reason the script appears to be ignored.Has anyone got any ideas?

Here's the cronjob part in question:

[CronjobPart-exportcsv]
ExtensionDirectories[]=exportcsv
Scripts[]=exportcsv.php
Cheers,

Cliff

cliffp pratt

Wednesday 28 April 2010 9:28:07 pm

Update - I can run cronparts as long as they are in the base settings/crontab.ini. Can anyone please help?

Cheers,

Cliff

Paul Leclercq

Wednesday 05 May 2010 8:10:21 am

You seem to have got something badly wrong here, this is the setting you should be using:

[CronjobSettings]
ExtensionDirectories[]=exportcsv
[CronjobPart-exportcsv]
Scripts[]=exportcsv.php

you then execute your cronpart from the root of your project this way:

php runcronjobs.php exportcsv

In that exemple the name of your cronpart is just behind the
[CronjobPart-NAME_OF_CRONPART]

php runcronjobs.php NAME_OF_CRONPART

If you then wish to run this from a crontab you will need to do write something like this in your /etc/crontab file:

-------------------------------------------------------
# This must be set to the directory where eZ Publish is installed.
EZPUBLISHROOT=/var/www/myproject_name/www
# Location of the PHP Command Line Interface binary.
PHP=/usr/bin/php

# Every ten minutes
*/10 * * * * su - www-data -c "cd $EZPUBLISHROOT && $PHP runcronjobs.php ezflow" > /tmp/ezflow.cron.log 2>&1

----------------------------------------------------------

But you have much better information here:
http://ez.no/doc/ez_publish/technical_manual/4_x/features/cronjobs/running_cronjobs

eZ debug

Timing: Jan 18 2025 02:17:47
Script start
Timing: Jan 18 2025 02:17:47
Module start 'content'
Timing: Jan 18 2025 02:17:47
Module end 'content'
Timing: Jan 18 2025 02:17:48
Script end

Main resources:

Total runtime0.8801 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 587.5781180.8516
Module start 'content' 0.00740.7115 768.4297518.0000
Module end 'content' 0.71880.1612 1,286.4297332.7734
Script end 0.8800  1,619.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4333210.0002
Check MTime0.00140.1617210.0001
Mysql Total
Database connection0.00060.066610.0006
Mysqli_queries0.806491.63051940.0042
Looping result0.00190.21271920.0000
Template Total0.853096.920.4265
Template load0.00210.235520.0010
Template processing0.850996.685320.4255
Template load and register function0.00020.023110.0002
states
state_id_array0.00070.076710.0007
state_identifier_array0.00200.224420.0010
Override
Cache load0.00180.2038550.0000
Sytem overhead
Fetch class attribute can translate value0.00140.162130.0005
Fetch class attribute name0.00120.130940.0003
XML
Image XML parsing0.00100.111230.0003
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00520.5935260.0002
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs