Configuring maintenance
| Note: This article is for an old version of OpenX. The latest OpenX documentation can be found at the following URLs: |
In order to function correctly, OpenX runs an hourly maintenance script which performs the following tasks:
- produces statistics from the previous hour
- activates and deactivates campaigns
- recalculates banner delivery priorities
- sends out email-based reports
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.
Built-in automatic maintenance
The OpenX built-in automatic maintenance script has several advantages:
- outstanding maintenance tasks are triggered by banner delivery
- enabled by default on new installations
- no need to create scheduled tasks
Automatic maintenance waits 5 minutes after the scheduled maintenance task was due to run, to ensure that any manually-scheduled maintenance has time to complete. With automatic maintenance you can:
- enable and disable automatic maintenance on the Settings>Main Settings page.
- view the current maintenance status on the Settings>Maintenance page.
- view the log of maintenance runs on the Settings>User Log.
Scheduled maintenance
Scheduling maintenance as a task is more flexible than automatic maintenance. You can start the maintenance script by:
- executing a locally run script
- calling the script url on the web server
Scheduling tasks on Linux and Unix
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. After logging on to your
server, use the following command to export your existing scheduled tasks
to a text file:
crontab -l > cron.txt
In a text editor, add one of the following entries to the cron.txt file:
-
If your server supports PHP CLI (Command Line Interface) - recommended
0 * * * * /path/to/php /path/to/OpenX/scripts/maintenance/maintenance.php www.mydomain.com
-
If your server supports wget:
0 * * * * wget -q -O /dev/null http://www.example.com/OpenX/maintenance/maintenance.php
-
If your server supports fetch:
0 * * * * fetch -o /dev/null http://www.example.com/OpenX/maintenance/maintenance.php
-
If your server supports lynx:
0 * * * * lynx > /dev/null -dump http://www.example.com/OpenX/maintenance/maintenance.php
When you have finished editing the cron.txt file, use the following command to import it into the cron daemon:
crontab cron.txt

RSS
Twitter
Facebook
FriendFeed