This directory contains definition of all maintenance scripts that should be run periodically.
Before the migration to Kubernetes these were run via crontab
on cron-s1
.
To generate YAML for one cron job:
./create-cronjob-yaml.sh one-time-job-example.yaml
In YAML describing a cron job there are two required fields: schedule and args Optionally you can pass server_id Name of cronjob is derived from a file name with a 'mediawiki-' prefix
e.g.
schedule: "35 20 * * *" # required
server_id: 3434 # optional, default: 177
args: # required
- php
- path/to/maintenance.php
- --param=1
To generate YAML for ALL cron jobs (except ones from 'examples' directory):
./cronjobs-generator.sh
In order to apply descriptor you need to map directory with YAML files to kubectl container.
Like so:
bash create-cronjob-yaml.sh one-time-job-example.yaml <prod image label> | kubectl --context kube-sjc-prod -n prod apply -f -
Or when running kubectl
as a binary (run from app directory root):
./maintenance/create-cronjob-yaml.sh one-time-job-example.yaml | kubectl --context kube-sjc-prod -n prod apply -f -
To apply all jobs defined run
./maintenance/cronjobs-generator.sh | kubectl --context kube-sjc-prod -n prod apply -f -
To check what cronjobs are currently scheduled:
kubectl --context kube-sjc-prod -n prod get cronJobs | grep mw-cj
extensions/wikia/WallNotifications/maintenance/cleanupNotificationsQueue.php
Removes old entries from dataware.wall_notification_queue* tables
extensions/wikia/PhalanxII/maintenance/cleanupPhalanxStats.php
Removes specials.phalanx_stats entries older than 365 days.
maintenance/cleanupUploadStash.php
Removes old or broken uploads from temporary uploaded file storage and cleans up associated database records.
extensions/wikia/WallNotifications/maintenance/cleanupWallNotifications.php
Removes dataware.wall_notification entries older than X days.
extensions/wikia/WikiaNewtalk/maintenance/cleanupWikiaSharedTalk.php
Removes wikicities.shared_newtalks entries older than 90 days.
maintenance/wikia/deleteArticlesByPrefix.php
Deletes articles from a wiki matching prefix QATestsUser/blogPost from namespace 500 (NS_BLOG_ARTICLE).
maintenance/wikia/deleteArticlesByPrefix.php
Deletes articles from a wiki matching prefix QABoard from namespace 2000 (NS_WIKIA_FORUM_BOARD).
maintenance/wikia/deleteArticlesByPrefix.php
Deletes articles from a wiki matching prefix ForumBoard from namespace 2000 (NS_WIKIA_FORUM_BOARD).
maintenance/wikia/deleteArticlesByPrefix.php
Deletes articles from a wiki matching prefix QAarticle from namespace 0 (NS_MAIN).
extensions/wikia/WikiFactory/Dumps/maintenance/DumpsOnDemandCron.php
Creates XML dumps of wikis requested via Special:Statistics.
extensions/wikia/CreateNewWiki/maintenance/dumpStarters.php
Prepares XML and SQL dumps with the latest revisions and *links
tables rows of starter wikis.
maintenance/updateSpecialPages.php
Updates various special pages that display aggregated data or reports.
maintenance/updateSpecialPages.php
Updates various special pages that display aggregated data or reports.
extensions/wikia/VideoHandlers/maintenance/findOutdatedVideoProviders.php
Search for outdated video providers and report occurrences to ELK and JIRA.
extensions/wikia/FounderEmails/FounderEmailsMaintenance.php
Sends informative emails about views, edits, etc. to founders of wikis; completeDigest.
extensions/wikia/FounderEmails/FounderEmailsMaintenance.php
Sends informative emails to founders of wikis after a number of days of their inactivity.
extensions/wikia/FounderEmails/FounderEmailsMaintenance.php
Sends informative emails about views to founders of wikis.
maintenance/initStats.php
Reinitialise or update wiki's statistics tables.
extensions/3rdparty/LyricWiki/maintenance/LyricsWikiCrawler.php
Crawls through LyricWiki, pulls data from its articles and puts it to Solr.
maintenance/wikia/phrase-alerts.php
Scans users' activity for certain suspicious phrases and alerts ComSup.
maintenance/wikia/removeQAWikis.php
Marks wikis created by automated tests for closing.
maintenance/wikia/cronjobs/resetWeeklyUserContributionsCount.php
maintenance/runescape-price-update-bot.yaml
Updates prices of items on runescape and oldschoolrunescape wikis using data from Jagex API
Reset weekly user rank on Special:Community.
extensions/wikia/AuthPages/maintenance/sendConfirmationReminder.php
Sends emails to users to remind them to authenticate / confirm their users.
maintenance/wikia/cronjobs/sendWeeklyDigest.php
This script sends the weekly digest to the users found in the global_watchlist table found in the dataware database.
maintenance/wikia/SiteWideMessagesMaintenance.php
Removes expired SiteWideMessages from MySQL.
extensions/wikia/SemanticMediaWiki/maintenance/rebuildConceptCache.php
Warms up semantic query cache for SemanticMediaWiki's Concept pages.
maintenance/updateSpecialPages.php
Updates various special pages that display aggregated data or reports.
extensions/wikia/WikiFactory/Close/maintenance.php
Closed wikis marked for closing.
extensions/wikia/WikiFactory/DeadWikis/maintenance.php
Scans through the communities for wikis meeting criteria of "dead wikis", sends reports to ComSup and removes dead wikis after a period of quarantine.