This page is a translated version of the page Manual:RunJobs.php and the translation is 67% complete.
Other languages:
English • ‎español • ‎français • ‎polski • ‎русский • ‎中文 • ‎日本語 • ‎한국어


Le fichier runJobs.php est un script de maintenance qui force manuellement la file d'attente des tâches à s'exécuter. Under normal circumstances jobs in the queue are run as a function of user interaction with the wiki (ordinary apache requests). The default rate jobs are run is 1 to 1 and can be changed by adjusting $wgJobRunRate in the "LocalSettings.php" file. Note that the default memory limit for a job is 150 MB to avoid a bad job does not consume all the server's memory.

You may wish to use this script because your wiki's traffic is too slow to clear the queue, or there may be an exceptionally large number of jobs to clear. Be advised though that for many server configurations this can cause your wiki to become sluggish or even unresponsive until the script completes. You would be advised to first try 50 or 100 to get a feel for the script's speed before running it with no parameters (this script defaults to 10,000 jobs cleared each time it is run) or for more than a few hundred jobs.

Note also that if you accidentally ran a script that loaded the job queue with a large number of undesired or unneeded jobs it is also possible to completely clear the job queue by clearing the job table in your wiki database. Be certain there are no jobs in the queue you need as all jobs will be irretrievably deleted.


php maintenance/runJobs.php

Utilisation avancée

php runJobs.php [--conf|--dbpass|--dbuser|--globals|--help|--maxjobs|--maxtime|--memory-limit|--nothrottle|--procs|--quiet|--server|--type|--wait|--wiki]

Paramètres de maintenance génériques

Option/paramètre Description
aucun paramètre Va exécuter les 10 000 prochaînes tâches qui se trouvent dans la file d'attente.
--help (-h) Afficher ce message d'aide
--quiet (-q) Indique s'il faut supprimer la sortie qui n'est pas en erreur
--conf Emplacement de LocalSettings.php, s'il n'est pas la valeur par défaut
--wiki Pour spécifier l'ID du wiki
--globals Produit les variables globales à la fin du traitement, pour le débogage
--memory-limit Set a specific memory limit for the script, "max" for no limit or "default" to avoid changing it
--server The protocol and server name to use in URLs, e.g. This is sometimes necessary because server name detection may fail in command line scripts.

Paramètres dépendants du script

Option/paramètre Description
--dbuser L'utilisateur DB à utiliser pour ce script
--dbpass Le mot de passe à utiliser pour ce script

Paramètres spécifiques au script

Option/paramètre Description
--maxjobs Nombre maximal de lignes à analyser
--maxtime Maximum amount of wall-clock time (in seconds)
--procs Nombre de processus à utiliser
--type Type de tâche à exécuter. Voir $wgJobClasses pour les types possibles de tâche.
--wait Attendre de nouvelles tâches plutôt que de sortir
--nothrottle Ignorer la configuration qui limite le nombre de tâches


php maintenance/runJobs.php --maxjobs 5 --type refreshLinks
/home/flowerwiki/public_html/w/maintenance$ php runJobs.php --maxjobs 5 --type refreshLinks

2010-10-29 13:50:38 refreshLinks Daisies t=501 good
2010-10-29 13:50:38 refreshLinks Magnolias t=501 good
2010-10-29 13:50:39 refreshLinks Heirloom_Roses t=500 good
2010-10-29 13:50:39 refreshLinks Carnations t=501 good
2010-10-29 13:50:40 refreshLinks Tulips t=563 good
It is not recommended to have "runJobs.php" run indefinitely without any limits (--maxjobs, --maxtime and/or --memory-limit). Typical usage involves periodic runs with at least one of the restrictions set to prevent it from running too long in one go.

Mises en garde

"runJobs.php" may hang under certain circumstances if you have object caching enabled.

If this happens, create another "LocalSettings.php" file without object caching enabled:

$wgMainCacheType = CACHE_NONE;

Then run "runJobs.php" with the --conf parameter to specify the location of the new LocalSettings.php file with caching disabled.

This is, however, not recommended, since some jobs will purge objects from the object cache, which won't get purged because caching is disabled. Ceci résultera en ce que certaines mises à jour ne seront pas reportées sur le wiki. Ideally, you should find the cause of the problem, usually a missing PHP extension in the php.ini of the php being run from the command line.

Voir aussi