Extension talk:EmailNotifications

Latest comment: 21 days ago by Richardpruen in topic Suggestion for periodic jobs

Suggestion for periodic jobs

edit

Suggestion for running the script, create ths bash script, then it can be started as a system service to run all the required jobs in one place

#!/bin/bash
# Put the MediaWiki installation path on the line below
MW_INSTALL_PATH="/var/www/my.wiki/htdocs/mediawiki"
# mediawiki requires jobs executed by this script
JOB_RUNNER="$MW_INSTALL_PATH/maintenance/run.php"
# mediawiki job runner
RUNJOBS="$MW_INSTALL_PATH/maintenance/runJobs.php"
# email notifications job runner
USERMAILER="$MW_INSTALL_PATH/extensions/EmailNotifications/maintenance/sendNotifications.php"
# any other job runners can be added here
# OTHER_JOB_QUEUE="$MW_INSTALL_PATH/extensions/ ..."
cd $MW_INSTALL_PATH
echo Starting job service...
# Wait a minute after the server starts up to give other processes time to get started
sleep 60
echo Started.
while true; do
    # mediawiki job runner service
    # the email notify can be commented out if not used
    #/usr/bin/php $JOB_RUNNER $RUNJOBS --type="enotifNotify"
    /usr/bin/php $JOB_RUNNER $RUNJOBS --maxjobs=200
    # User mailer jobs
    /usr/bin/php $JOB_RUNNER $USERMAILER
    # Wait some seconds to let the CPU do other things, like handling web requests, etc
    echo Waiting for 30 seconds...
    sleep 30
done

Richardpruen (talk) 13:30, 30 November 2024 (UTC)Reply

Return to "EmailNotifications" page.