打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

帮助:维护脚本:修订间差异

来自陋室
删除的内容 添加的内容
XP-jia留言 | 贡献
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 rebuildall.php
php maintenance/run.php refreshLinks.php


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


# 执行队列任务
# 刷新页面中的链接数据
php maintenance/run.php refreshLinks.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:帮助文档]]