Cronjobs and multiple siteaccesses

Author Message

Piotrek Karaś

Sunday 15 April 2007 12:02:44 am

Hello,

Few questions about cronjobs execution in a multiple siteaccess eZ publish installation:
a) Do I have to execute cronjobs for each and every siteaccess? Why?
b) Is there a way/a reason to execute cronjobs for all siteaccesses at once or should I execute them separately?
c) Do I need to run cronjobs for the admin interface? Why or why not?
d) If I run cronjobs for all the siteaccesses, wouldn't at least some of the actions be redundant?

It doesn't seem to be covered by the documentation. Similar topic has already been posted, but it was three years ago, and the problem wasn't really solved.

Thank you for any help.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Felix Woldt

Sunday 15 April 2007 4:10:26 am

Hello,

> a) Do I have to execute cronjobs for each and every siteaccess? Why?

Yes you have! Because every siteaccess have different ini settings, which are used by processing the cronjob.

> b) Is there a way/a reason to execute cronjobs for all siteaccesses at once or should I execute them separately?

A way to execute a cronjob for all siteaccess could be, write a new shell or php script which execute all runcronjobs.php -s siteaccess .

> c) Do I need to run cronjobs for the admin interface? Why or why not?

Yes i think so, if you use workflows / notifications / link checking ...

> d) If I run cronjobs for all the siteaccesses, wouldn't at least some of the actions be redundant?

Why redundant? If you only process cronjobs you are needed, then you have no redundance. Which cronjobs should be run you can set in cronjob.ini.append.php of every siteaccess. If you want to split the cronjobs you can use new blocks in cronjob.ini.append.php maybe a block [daily] , [weekly] =>

runcronjobs.php daily -s siteaccess1 
runcronjobs.php weekly -s siteaccess1 

See documentation. So you can process large scripts like link checkung once a week and notifications.php for example every 15 minutes.

Take care. Only run needed cronjobs! Otherwise the server have to work to much ;-)

Greetings
Felix Woldt

http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com

CJW Newsletter 1.0.0 released: http://projects.ez.no/cjw_newsletter

Heath

Sunday 15 April 2007 4:17:45 am

These are fair references, <i>http://ezpedia.org/wiki/en/ez/cronjob
http://ez.no/doc/ez_publish/technical_manual/3_8/features/cronjobs
http://ez.no/doc/ez_publish/technical_manual/3_8/features/cronjobs/configuring_cronjobs</i>

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Piotrek Karaś

Sunday 15 April 2007 5:16:19 am

@Heath: I'm really convinced that answers to at least some of my questions aren't covered in the docs (or maybe I just don't see them yet - I keep reading the entire documentation every few weeks to discover new useful facts, that I hadn't been able to understand or attach before :))) Thanks anyway!

@Felix:
<i>>> b) Is there a way/a reason to execute cronjobs for all siteaccesses at once or should I execute them separately?
>A way to execute a cronjob for all siteaccess could be, write a new shell or php script which execute all runcronjobs.php -s siteaccess .</i>

I was rather thinking of a build-in capability, but of course a group of executions should do it as well.

<i>>> c) Do I need to run cronjobs for the admin interface? Why or why not?
>Yes i think so, if you use workflows / notifications / link checking ...</i>
<i>>> d) If I run cronjobs for all the siteaccesses, wouldn't at least some of the actions be redundant?
>Why redundant? If you only process cronjobs you are needed, then you have no redundance.</i>

So how do I know which cronjobs to choose for particular siteaccess?

I just ran default cronjobs on a default installation for both admin and user sites. I read a message that in both cases all of the links were checked. Conclusion: I probably only need to check the links for admin interface, two would be redundant. Is that correct?

Things get more complicated when it comes to content, for example. Let's take indexcontent.php script, which, according to the manual, performs delayed search indexing of newly added content objects. Let's say we have two user sites: user1 (English) and user2 (German), same structure, but different languages (using content translations). At some point we create new nodes with some content that should be indexed, and that includes translations. What happens if we only run content indexing for user1, but not user2? How would the situation be affected by default object availability option? Would the situation be the same or different if we had two separate structures for both sites? It's possible that I shouldn't worry about those things, but then would I be able to tell which cronjob scripts are required for which siteaccess? :)

<i>> Only run needed cronjobs! Otherwise the server have to work to much ;-)</i>

This is one of the reasons why I need to have good control over cronjobs - my hosting solution has a number of 'mean' limitations, while most of my eZ publish installations are multi-site.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Heath

Sunday 15 April 2007 5:46:28 am

Take a look at the stock cronjob.ini settings file, <i>http://pubsvn.ez.no/nextgen/trunk/settings/cronjob.ini</i>

You could simple create an override of this settings file in your siteaccess, <i>settings/siteaccess/ezwebin_user_site/cronjob.ini.append.php</i>

You can then customize these settings to meet your own needs, here is an example of most of the available cronjobs separated into two groups, frequent (run very regularly, say hourly) and infrequent (run once a week).

[CronjobPart-infrequent]
Scripts[]=basket_cleanup.php
Scripts[]=linkcheck.php
Scripts[]=rssimport.php
Scripts[]=indexcontent.php
Scripts[]=subtreeexpirycleanup.php
Scripts[]=internal_drafts_cleanup.php

[CronjobPart-frequent]
Scripts[]=notification.php
Scripts[]=workflow.php
Scripts[]=unpublish.php
Scripts[]=hide.php
#Scripts[]=updateviewcount.php

Then you should be able to run each of these cronjob 'parts' or groups of cronjobs individually from crontab. Here is an example

52 3,23 * * * cd /web/pro/doc/; ./runcronjobs.php frequent

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Piotrek Karaś

Sunday 15 April 2007 12:40:54 pm

Thanks for the technical details, I think I have now the <b>how</b> part pretty much covered and clear. Just waiting for someone to shed some light on the <b>why</b> part :)
Greetings!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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