說明:維護腳本

XP-jia​(對話 | 貢獻)2025年3月8日 (六) 00:14的修訂 (new)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)

常用維護腳本

這些腳本涉及到數據庫優化、文件清理、索引重建、權限更新等操作,通常是為了確保 MediaWiki 實例能夠穩定運行,並且提升性能和響應速度。

數據庫優化與更新

# 更新数据库架构(快速模式,不做过多检查)
php maintenance/run.php update.php --quick

# 重建数据库中的“最近更改”记录
php maintenance/run.php rebuildrecentchanges.php

# 重建所有内容(页面、修订、文件等)
php maintenance/run.php rebuildall.php

# 重建文本索引(用于全文搜索)
php maintenance/run.php rebuildtextindex.php

# 刷新页面中的链接数据
php maintenance/run.php refreshLinks.php

# 清理无效的页面标题(干运行模式,仅模拟,不做实际修改)
php maintenance/run.php cleanupTitles.php --dry-run

分類和頁面維護

# 删除过期的修订记录,减少数据库体积(干运行模式,仅模拟,不做实际删除)
php maintenance/run.php deleteOldRevisions.php --dry-run

作業與後台處理

# 手动执行所有后台作业,确保没有待处理的作业(如图片处理、邮件发送等)
php maintenance/run.php runJobs.php