This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Cron job setup best practice
expandshrink

Cron job setup best practice

Cron job setup best practice

Friday 01 July 2011 2:49:03 pm - 6 replies

Hi,

I'm curious as to what is the best practice for cron job setup, by which I mean which cron jobs that should be run, and how often.

I am of course aware that this varies depending on the site, and I have also gone through the docs at eZ any. However, what I'm missing is a mention of which cron jobs that should be run regulary (regardless of functionality) to ensure a clean and smooth running eZ Publish web site.

So, how are you guys configuring your cron jobs?

Friday 01 July 2011 3:18:51 pm

Hi Eirik

The basics would be to setup your crontab with something like what's in ezpublish.cron fil (inside your eZ root, aside to index.php) :

# This must be set to the directory where eZ Publish is installed.
EZPUBLISHROOT=/path/to/the/ez/publish/directory
 
# Location of the PHP Command Line Interface binary.
PHP=/usr/local/bin/php
 
# Instruct cron to run the main set of cronjobs
# at 6:35am every day
35 6 * * * cd $EZPUBLISHROOT && $PHP runcronjobs.php -q 2>&1
 
# Instruct cron to run the "infrequent" set of cronjobs
# at 5:20am every Monday
20 5 * * 1 cd $EZPUBLISHROOT && $PHP runcronjobs.php -q infrequent 2>&1
 
# Instruct cron to run the "frequent" set of cronjobs
# every 15 minutes
0,15,30,45 * * * * cd $EZPUBLISHROOT && $PHP runcronjobs.php -q frequent 2>&1

For your own cronjobs, well it's up to you and what does your script, of course. Just be aware that a cronjob cannot be run several times at once (mutex protection).

Friday 01 July 2011 3:37:29 pm

Hi Jérôme,

Thanks for the reply. However, I'm not asking how to set up a cron job from a technical perspectice, but rather which specific cronjobs that should be a part of the frequent and less frequent cron job parts.

Friday 01 July 2011 4:12:38 pm

Hi Eirik

No offenese, that was actually the purpose of my previous reply, to show you the basic cronjobs to make eZ Publish work properly :

  • frequent - every 15 min, or less
  • main set (runcronjobs.php without argument) - once a day (preferably during the night, but depends on the targeted audience)
  • infrequent - once a week

Monday 04 July 2011 6:34:28 pm

Looking at the cronjobs in the "standard" groups:

- frequent: notifications - needed if users can subscribe to notifications

- frequent: workflows - needed if workflows are in place

- ezflow: ezflow - needed if you run ezflow

- standard: unpublish: if you use time-based depublication of content

- standard: hide: if you use time-based hiding of content

- standard: rssimport: if you set up import of content via rss feeds

- standard: indexcontent: if you use DelayedIndexing only

- standard: subtreeexpirycleanup: only needed if you enable some obscure clustering/storage parameter

- standard: internal_drafts_cleanup: I never understood what are internal drafts, but you'd better leave this on

- infrequent: basket_cleanup: only if you have webshop enabled

- infrequent: linkcheck: I've never seen an editor actually going to check the results of that script and fixing the broken links...

Now that I've done my part, a task for you community peeps: add a --list option to runcronjobs.php that would list all cronjobs parts and scripts contained in each one. Who wanna git a little bit?

Monday 04 July 2011 6:40:24 pm

Now that I've done my part, a task for you community peeps: add a --list option to runcronjobs.php that would list all cronjobs parts and scripts contained in each one. Who wanna git a little bit?

Awesome idea.

Friday 29 July 2011 5:34:00 pm

Hi,

You may add "session_gc.php" to the infrequent part.
Otherwise it seems that the session table grows indefinitely.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from