To function correctly, OpenX runs a regular maintenance script (the default period is hourly) which:
You can run the maintenance script in two ways:
OpenX will continue to run if the maintenance script is not executed. However, if the maintenance script does not run campaigns with an expiry date or a fixed number of impressions will be delivered more often than desired. If you are having problems delivering these types of campaigns, check that the maintenance script is running correctly. When the maintenance script runs, all outstanding raw data is processed.
The OpenX built-in automatic maintenance script has several advantages:
Automatic maintenance waits for five minutes after the scheduled maintenance task was due to run. This delay ensures that any manually-scheduled maintenance has time to complete. With automatic maintenance you can:
Scheduling maintenance as a task is more flexible than automatic maintenance. You can start the maintenance script by:
On Linux, BSD, Solaris or MacOSX you can use the cron daemon to automatically run the maintenance script. In most cases you will need shell access to your server to add cron tasks, using the following commands:
crontab -l > cron.txt
0 * * * * /path/to/php /path/to/openx/scripts/maintenance/maintenance.php www.mydomain.com
0 * * * * wget \-q \-O /dev/null [http://www.example.com/Openx/maintenance/maintenance.php]
0 * * * * fetch \-o /dev/null [http://www.example.com/Openx/maintenance/maintenance.php]
0 * * * * lynx > /dev/null \-dump [http://www.example.com/Openx/maintenance/maintenance.php]
crontab cron.txt
If running PHP release 5.0 or lower, for time zones to work correctly you must set up the TZ environment variable when setting up maintenance via cron. This is the same process you wouuld follow in the Apache configuration.
This task requires an entry similar to the following in the crontab file:
TZ='Europe/Berlin'
1 * * * * /path/to/php /path/to/openx/scripts/maintenance/maintenance.php www.mysite.com
If you do not enter this setting it is likely that time zones will work correctly for half the year, but not in Summer Time.
With PHP release 5.1 or higher this setting is not required, as the setting is managed by the php.ini file.