Help:Job queue

From semantic-mediawiki.org
Jump to: navigation, search
Table of Contents

This page advises on doing maintenance by using a shell script to work on the jobs piped into a job queue by Semantic MediaWiki, but also by MediaWiki itself and other extensions relying on jobs.

Cron job

Set $wgJobRunRate = 0; in your "LocalSettings.php" file and create the script in a file called "runJobs0.sh"1 or alternatively "runJobs1.sh"2

runJobs0.sh
#!/bin/bash
# will be executed by a cron-job 

MEDIAWIKI=/path/to/your/mediawiki 
RUNNING=$(ps aux | grep /mediawiki/maintenance/runJobs.php | grep maxjobs) 
if [ -z $RUNNING ];
    then su XXX -c "php $MEDIAWIKI/maintenance/runJobs.php --maxjobs=999";
fi
runJobs1.sh
#!/bin/bash
# will be executed by a cron-job

date >> /var/log/httpd/cron

if pgrep -f "php /var/www/html/w/maintenance/runJobs.php -q --memory-limit=max --wait" > /dev/null
    then
        echo "runJobs running." >> /var/log/httpd/cron
        kill `pgrep -f "php /var/www/html/w/maintenance/runJobs.php -q --memory-limit=max --wait"`
fi

echo "runJobs stopped. Restarting..." >> /var/log/httpd/cron

php /var/www/html/w/maintenance/runJobs.php -q --memory-limit=max --wait >> /var/log/httpd/cron 2>&1 &

MediaWiki

Mail discussions

See also