eZ Community » Forums » General » Sharing a little script for managing...
expandshrink

Sharing a little script for managing cronjobs for multiple websites

Sharing a little script for managing cronjobs for multiple websites

Monday 22 April 2013 11:35:08 am - 4 replies

Hey guysJust wanted to share a little script with the community.When you run a lot of ez publish websites you need to setup ez cronjobs for each of them, it can get very long for editing. I personally find that confusing to swim through those lines...

So I just quickly created this piece of script where you configure the commands to be run and the list of websites and their settings (path to root, sudo user etc...).

Then your cron will look like this:

# eZ Publish websites maintenance cronjobs
 
##########################################
 
SCRIPTROOT=/var/lib/ezpublish/cronjobs/
 
# Location of the PHP Command Line Interface binary.
 
PHP=/usr/bin/php
 
# Instruct cron to run the main set of cronjobs
 
# every day
 
35 6 * * * cd $SCRIPTROOT && $PHP runezcronjobs.php generic 2>&1
 
05 4 * * * cd $SCRIPTROOT && $PHP runezcronjobs.php expired_session 2>&1
 
# Instruct cron to run the "infrequent" set of cronjobs
 
# every Monday
 
20 5 * * 1 cd $SCRIPTROOT && $PHP runezcronjobs.php infrequent 2>&1
 
# Re-launch precompile script every week
 
20 5 * * 6 cd $SCRIPTROOT && $PHP runezcronjobs.php eztc 2>&1
 
# Instruct cron to run the "frequent" set of cronjobs
 
# every 15 minutes
 
0,15,30,45 * * * * cd $SCRIPTROOT && $PHP runezcronjobs.php frequent 2>&1
 
# eZ Flow cronjobs
 
*/10 * * * * cd $SCRIPTROOT && $PHP runezcronjobs.php ezflow 2>&1
 
*/10 * * * * cd $SCRIPTROOT && $PHP runezcronjobs.php runscheduledscripts 2>&1

Update:

Here is the forgotten link to the source: https://github.com/quochuy/qhezbatchcron

Modified on Wednesday 08 May 2013 11:13:08 am by Quoc-Huy NGUYEN DINH

Monday 06 May 2013 11:16:22 am

Nice post,I agree with all of the above

Wednesday 08 May 2013 10:37:13 am

Mmm, see no link to sources in this post. is this it?

https://github.com/quochuy/qhezbatchcron

Wednesday 08 May 2013 11:12:36 am

Ooops!

I was sure I added it... Must have deleted it by mistake with the multiple edits...

Yes it is qhezbatchcron

Huy

Wednesday 08 May 2013 11:15:18 am

I'll probably add the ability to split the INI file into multiple subfiles, one per site. Easier for maintenance.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from