<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://learn.devc.dev/w/history/%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC?feed=atom</id>
	<title>帮助:维护脚本 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://learn.devc.dev/w/history/%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC?feed=atom"/>
	<link rel="alternate" type="text/html" href="https://learn.devc.dev/w/history/%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC"/>
	<updated>2026-04-08T22:26:54Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://learn.devc.dev/index.php?title=%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC&amp;diff=1599&amp;oldid=prev</id>
		<title>Maintenance script：​补充维护脚本执行提示</title>
		<link rel="alternate" type="text/html" href="https://learn.devc.dev/index.php?title=%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC&amp;diff=1599&amp;oldid=prev"/>
		<updated>2025-12-26T13:12:40Z</updated>

		<summary type="html">&lt;p&gt;补充维护脚本执行提示&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2025年12月26日 (五) 21:12的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第22行：&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第22行：&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;php maintenance/run.php cleanupTitles.php --dry-run&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;php maintenance/run.php cleanupTitles.php --dry-run&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 运行提示 ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 使用服务器上的 PHP CLI 执行维护脚本，通常用 &amp;lt;code&amp;gt;php maintenance/run.php 脚本名&amp;lt;/code&amp;gt;，避免通过 Web 访问。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 如果站点部署了多个 PHP 版本，可先运行 &amp;lt;code&amp;gt;php -v&amp;lt;/code&amp;gt; 或指定完整路径（如 &amp;lt;code&amp;gt;/usr/bin/php8.2&amp;lt;/code&amp;gt;）以确保使用与 Wiki 一致的运行时。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 对于耗时的脚本（如 rebuildtextindex.php、rebuildrecentchanges.php），建议在流量低峰期执行，并记录输出、检查 &amp;lt;code&amp;gt;maintenance/logs&amp;lt;/code&amp;gt;。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 不确定命令合适时，可先添加 &amp;lt;code&amp;gt;--help&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; 选项查看安全性，例如：&amp;lt;code&amp;gt;php maintenance/run.php deleteOldRevisions.php --dry-run&amp;lt;/code&amp;gt;。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 分类和页面维护 ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 分类和页面维护 ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key learn:diff:1.41:old-946:rev-1599:wikidiff2=table:1.13.0:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://learn.devc.dev/index.php?title=%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC&amp;diff=946&amp;oldid=prev</id>
		<title>XP-jia：​new</title>
		<link rel="alternate" type="text/html" href="https://learn.devc.dev/index.php?title=%E5%B8%AE%E5%8A%A9:%E7%BB%B4%E6%8A%A4%E8%84%9A%E6%9C%AC&amp;diff=946&amp;oldid=prev"/>
		<updated>2025-03-07T16:14:09Z</updated>

		<summary type="html">&lt;p&gt;new&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 常用维护脚本 ==&lt;br /&gt;
这些脚本涉及到数据库优化、文件清理、索引重建、权限更新等操作，通常是为了确保 MediaWiki 实例能够稳定运行，并且提升性能和响应速度。&lt;br /&gt;
== 数据库优化与更新 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# 更新数据库架构（快速模式，不做过多检查）&lt;br /&gt;
php maintenance/run.php update.php --quick&lt;br /&gt;
&lt;br /&gt;
# 重建数据库中的“最近更改”记录&lt;br /&gt;
php maintenance/run.php rebuildrecentchanges.php&lt;br /&gt;
&lt;br /&gt;
# 重建所有内容（页面、修订、文件等）&lt;br /&gt;
php maintenance/run.php rebuildall.php&lt;br /&gt;
&lt;br /&gt;
# 重建文本索引（用于全文搜索）&lt;br /&gt;
php maintenance/run.php rebuildtextindex.php&lt;br /&gt;
&lt;br /&gt;
# 刷新页面中的链接数据&lt;br /&gt;
php maintenance/run.php refreshLinks.php&lt;br /&gt;
&lt;br /&gt;
# 清理无效的页面标题（干运行模式，仅模拟，不做实际修改）&lt;br /&gt;
php maintenance/run.php cleanupTitles.php --dry-run&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 分类和页面维护 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# 删除过期的修订记录，减少数据库体积（干运行模式，仅模拟，不做实际删除）&lt;br /&gt;
php maintenance/run.php deleteOldRevisions.php --dry-run&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 作业与后台处理 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# 手动执行所有后台作业，确保没有待处理的作业（如图片处理、邮件发送等）&lt;br /&gt;
php maintenance/run.php runJobs.php&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Template:站点帮助文档}}&lt;/div&gt;</summary>
		<author><name>XP-jia</name></author>
	</entry>
</feed>