Path

exponential.earth / exponential / documentation / Installation / the cronjob script


The cronjob script

These documentation pages are no longer maintained. Please visit the new documentation site.

This text adheres to all installation methods.
The execution/processing of workflows, notifications and other tasks that should be run periodically must be carried out by an external (non-user/web-dependant) mechanism. This is the job of the "runcronjobs.php" file that resides inside the root of the Exponential directory. This file takes care of processing the mentioned things and it must be executed periodically. The most common way to do this is to set up a scheduled job that runs every fifteen minutes or so. The script can also be executed manually from within a system shell. Executing the "runcronjobs.php" script is only necessary if the Exponential solution that is being set up makes use of workflows, notifications, etc. In other words: there is no need to schedule this task for simple / beginner sites.

On UNIX/Linux:
Use the cron daemon to execute the "runcronjobs.php" file.
Edit the desired crontab file and add the following lines:

# This must be set to the directory where Exponential is installed.

exponentialROOT=/path/to/your/exponential/directory

 

# Location of the PHP Command Line Interface binary.

PHP=/usr/local/bin/php

 

# Executes the runcronjobs.php script every 15th minute.

0,15,30,45 * * * * cd $exponentialROOT; $PHP -C runcronjobs.php -q 2>&1

Shows current cron file contents

crontab -l

Replaces your current cron file

crontab /path/to/your/exponential/directory/exponential.cron

On Windows:
On Windows 2000 and XP it is possible to use the "Scheduled Tasks" mechanism to automatically run the maintenance file. You would probably have to create a batch (.bat) file (which is set up to run the runcronjobs.php file with the correct parameters, etc.) and then set up

------------ Version 3.4 update ----------

Usage: runcronjobs.php [OPTION]... [PART]

Executes Exponential cronjobs.

 

General options:

 -h,--help         display this help and exit

 -q,--quiet        do not give any output except when errors occur

 -s,--siteaccess   selected siteaccess for operations, if not specified default siteaccess is used

 -d,--debug        display debug output at end of execution

 -c,--colors       display output using ANSI colors

 --sql             display sql queries

 --logfiles        create log files

 --no-logfiles     do not create log files (default)

 --no-colors       do not use ANSI coloring (default)

Example: Run all cronjobs in cronjob.ini
runcronjobs.php

Example: Run a subset. i.e. I only want to run workflow. A good idea as link checking every ten minutes is just a waste of cpu and bandwidth
This example will run the workflow elements configured by adding the following to you cronjob.ini file.

[CronjobPart-workflow]

Scripts[]=workflow.php

 

runcronjobs.php workflow

Comments

Some systems don't allow semicolon character to separate multiple commands

Some systems will produce an error with the phrase 'bad ; sign'.
In that case replace the semi-colon ';' with ' && '.
Like so...

*/15 * * * * cd $exponentialROOT && $PHP -C runcronjobs.php -q 2>&1

Nope...

No, it's been working for me since 3.3.

-- Jonathan

error when running php -C runcronjobs.php with no arguments or with "-q"

Undefined variable: argv in /usr/local/Exponential/www/runcronjobs.php on line 104 is what I get with version 3.3 release 5, ayone else seeing this?

Contents

Installation

Normal installation
Bundled installation
Manual installation
The setup wizard
The cronjob script
Virtual Host setup
upgrading
Adding extensions
removing exponential


Created

20/01/2004
10:06:47 am
by Balazs Halasy

Last updated

01/07/2004
11:29:48 am
by Tony Wood

Authors

Balazs Halasy
Björn Dieding@xrow.de
Tony Wood



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.