帮助:维护脚本:修订间差异
来自陋室
更多操作
删除的内容 添加的内容
new |
Maintenance script(留言 | 贡献) 帮助命名空间规范化:移除一级标题并修正渲染安全写法 |
||
| (未显示同一用户的2个中间版本) | |||
| 第1行: | 第1行: | ||
本页列出站点常用维护脚本及适用场景。执行前请先备份数据库。 |
|||
这些脚本涉及到数据库优化、文件清理、索引重建、权限更新等操作,通常是为了确保 MediaWiki 实例能够稳定运行,并且提升性能和响应速度。 |
|||
== 数据库优化与更新 == |
|||
== 常用脚本 == |
|||
<syntaxhighlight lang="bash"> |
<syntaxhighlight lang="bash"> |
||
# 更新数据库 |
# 更新数据库结构 |
||
php maintenance/run.php update.php --quick |
php maintenance/run.php update.php --quick |
||
# 重建 |
# 重建最近更改 |
||
php maintenance/run.php rebuildrecentchanges.php |
php maintenance/run.php rebuildrecentchanges.php |
||
| ⚫ | |||
# 重建所有内容(页面、修订、文件等) |
|||
php maintenance/run.php |
php maintenance/run.php refreshLinks.php |
||
# 重建文 |
# 重建全文索引 |
||
php maintenance/run.php rebuildtextindex.php |
php maintenance/run.php rebuildtextindex.php |
||
# 执行队列任务 |
|||
| ⚫ | |||
php maintenance/run.php |
php maintenance/run.php runJobs.php |
||
# 清理无效的页面标题(干运行模式,仅模拟,不做实际修改) |
|||
php maintenance/run.php cleanupTitles.php --dry-run |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
== |
== 使用建议 == |
||
* 维护窗口执行,避免业务高峰。 |
|||
* 先在测试环境验证脚本副作用。 |
|||
<syntaxhighlight lang="bash"> |
|||
* 记录执行时间、参数和结果,便于追踪。 |
|||
# 删除过期的修订记录,减少数据库体积(干运行模式,仅模拟,不做实际删除) |
|||
php maintenance/run.php deleteOldRevisions.php --dry-run |
|||
</syntaxhighlight> |
|||
== 作业与后台处理 == |
|||
<syntaxhighlight lang="bash"> |
|||
# 手动执行所有后台作业,确保没有待处理的作业(如图片处理、邮件发送等) |
|||
php maintenance/run.php runJobs.php |
|||
</syntaxhighlight> |
|||
{{Template:站点帮助文档}} |
{{Template:站点帮助文档}} |
||
[[Category:帮助文档]] |
|||
2026年5月21日 (四) 11:19的最新版本
本页列出站点常用维护脚本及适用场景。执行前请先备份数据库。
常用脚本
# 更新数据库结构
php maintenance/run.php update.php --quick
# 重建最近更改
php maintenance/run.php rebuildrecentchanges.php
# 刷新链接关系
php maintenance/run.php refreshLinks.php
# 重建全文索引
php maintenance/run.php rebuildtextindex.php
# 执行队列任务
php maintenance/run.php runJobs.php
使用建议
- 维护窗口执行,避免业务高峰。
- 先在测试环境验证脚本副作用。
- 记录执行时间、参数和结果,便于追踪。