4
4
<refmeta>
5
5
<refentrytitle><application>pg_archivecleanup</application></refentrytitle>
6
6
<manvolnum>1</manvolnum>
7
+ <!--
7
8
<refmiscinfo>Application</refmiscinfo>
9
+ -->
10
+ <refmiscinfo>应用</refmiscinfo>
8
11
</refmeta>
9
12
10
13
<refnamediv>
11
14
<refname>pg_archivecleanup</refname>
15
+ <!--
12
16
<refpurpose>clean up <productname>PostgreSQL</productname> WAL archive files</refpurpose>
17
+ -->
18
+ <refpurpose>清理<productname>PostgreSQL</productname> WAL归档文件</refpurpose>
13
19
</refnamediv>
14
20
15
21
<indexterm zone="pgarchivecleanup">
26
32
</refsynopsisdiv>
27
33
28
34
<refsect1>
29
- <title>Description</title>
35
+ <!--
36
+ <title>Description</title>
37
+ -->
38
+ <title>描述</title>
30
39
31
- <para>
40
+
41
+ <!--
42
+ <para>
32
43
<application>pg_archivecleanup</> is designed to be used as an
33
44
<literal>archive_cleanup_command</literal> to clean up WAL file archives when
34
45
running as a standby server (see <xref linkend="warm-standby">).
35
46
<application>pg_archivecleanup</> can also be used as a standalone program to
36
47
clean WAL file archives.
37
48
</para>
49
+ -->
50
+ <para>
51
+ <application>pg_archivecleanup</>被设计来用作<literal>archive_cleanup_command</literal>,
52
+ 在作为备用服务器运行时清理WAL文件归档(参阅<xref linkend="warm-standby">)。
53
+ <application>pg_archivecleanup</>也可以用作一个单独的程序清理WAL文件归档。
54
+ </para>
38
55
39
- <para>
56
+ <!--
57
+ <para>
40
58
To configure a standby
41
59
server to use <application>pg_archivecleanup</>, put this into its
42
60
<filename>recovery.conf</filename> configuration file:
@@ -46,7 +64,17 @@ archive_cleanup_command = 'pg_archivecleanup <replaceable>archivelocation</> %r'
46
64
where <replaceable>archivelocation</> is the directory from which WAL segment
47
65
files should be removed.
48
66
</para>
49
- <para>
67
+ -->
68
+ <para>
69
+ 要配置备用服务器使用<application>pg_archivecleanup</>,将下列代码放入
70
+ <filename>recovery.conf</filename>配置文件中:
71
+ <programlisting>
72
+ archive_cleanup_command = 'pg_archivecleanup <replaceable>archivelocation</> %r'
73
+ </programlisting>
74
+ 这里的<replaceable>archivelocation</>是应该被移除的WAL段文件的目录。
75
+ </para>
76
+ <!--
77
+ <para>
50
78
When used within <xref linkend="archive-cleanup-command">, all WAL files
51
79
logically preceding the value of the <literal>%r</> argument will be removed
52
80
from <replaceable>archivelocation</>. This minimizes the number of files
@@ -57,14 +85,33 @@ archive_cleanup_command = 'pg_archivecleanup <replaceable>archivelocation</> %r'
57
85
long-term WAL archive area, or when multiple standby servers are recovering
58
86
from the same archive location.
59
87
</para>
60
- <para>
88
+ -->
89
+ <para>
90
+ 当在<xref linkend="archive-cleanup-command">中使用时,所有逻辑上在<literal>%r</>
91
+ 参数值之前的WAL文件都将从<replaceable>archivelocation</>中移除。
92
+ 这在保存崩溃-重启能力时,最小化了需要保留的文件数量。
93
+ 如果<replaceable>archivelocation</>是这个特殊的备用服务器的瞬态暂存区域,
94
+ 那么使用这个参数是合适的,但是在<replaceable>archivelocation</>
95
+ 用作长期WAL归档区,或者多个备用服务器是从同一个归档位置恢复而来的时,
96
+ 是<emphasis>不</>合适的。
97
+ </para>
98
+
99
+ <para>
100
+ <!--
61
101
When used as a standalone program all WAL files logically preceding the
62
102
<replaceable>oldestkeptwalfile</> will be removed from <replaceable>archivelocation</>.
63
103
In this mode, if you specify a <filename>.backup</> file name, then only the file prefix
64
104
will be used as the <replaceable>oldestkeptwalfile</>. This allows you to remove
65
105
all WAL files archived prior to a specific base backup without error.
66
106
For example, the following example will remove all files older than
67
107
WAL file name <filename>000000010000003700000010</>:
108
+ -->
109
+ 当用作独立程序时,所有逻辑上在<replaceable>oldestkeptwalfile</>
110
+ 之前的WAL文件都将从<replaceable>archivelocation</>中移除。
111
+ 在这个模式中,如果你声明一个<filename>.backup</>文件名,
112
+ 那么只有文件前缀将被用作<replaceable>oldestkeptwalfile</>。
113
+ 这允许你无误的删除所有在一个特定基础备份之前归档的WAL文件。
114
+ 例如,下面的例子将删除所有比WAL文件名<filename>000000010000003700000010</>更老的文件:
68
115
<programlisting>
69
116
pg_archivecleanup -d archive 000000010000003700000010.00000020.backup
70
117
@@ -73,104 +120,169 @@ pg_archivecleanup: removing file "archive/00000001000000370000000F"
73
120
pg_archivecleanup: removing file "archive/00000001000000370000000E"
74
121
</programlisting>
75
122
</para>
76
- <para>
123
+
124
+ <!--
125
+ <para>
77
126
<application>pg_archivecleanup</application> assumes that
78
127
<replaceable>archivelocation</> is a directory readable and writable by the
79
128
server-owning user.
80
129
</para>
130
+ -->
131
+ <para>
132
+ <application>pg_archivecleanup</application>假设<replaceable>archivelocation</>
133
+ 是一个服务器所有者用户可读和可写的目录。
134
+ </para>
81
135
</refsect1>
82
136
83
137
<refsect1>
138
+ <!--
84
139
<title>Options</title>
140
+ -->
141
+ <title>选项</title>
85
142
86
- <para>
143
+
144
+ <para>
145
+ <!--
87
146
<application>pg_archivecleanup</application> accepts the following command-line arguments:
88
-
147
+ -->
148
+ <application>pg_archivecleanup</application>接受下列命令行参数:
89
149
<variablelist>
90
150
91
151
<varlistentry>
92
152
<term><option>-d</option></term>
93
153
<listitem>
154
+ <!--
94
155
<para>
95
156
Print lots of debug logging output on <filename>stderr</>.
96
157
</para>
158
+ -->
159
+ <para>
160
+ 在<filename>stderr</>上打印大量的调试日志输出。
161
+ </para>
97
162
</listitem>
98
163
</varlistentry>
99
164
100
165
<varlistentry>
101
166
<term><option>-n</option></term>
102
167
<listitem>
103
- <para>
168
+ <!--
169
+ <para>
104
170
Print the names of the files that would have been removed on <filename>stdout</> (performs a dry run).
105
171
</para>
172
+ -->
173
+ <para>
174
+ 打印将要在<filename>stdout</>上删除的文件名(执行一个空运行)。
175
+ </para>
106
176
</listitem>
107
177
</varlistentry>
108
178
109
179
<varlistentry>
110
180
<term><option>-V</></term>
111
181
<term><option>--version</></term>
112
182
<listitem>
113
- <para>
183
+ <!--
184
+ <para>
114
185
Print the <application>pg_archivecleanup</application> version and exit.
115
186
</para>
187
+ -->
188
+ <para>
189
+ 打印<application>pg_archivecleanup</application>的版本并退出。
190
+ </para>
116
191
</listitem>
117
192
</varlistentry>
118
193
119
194
<varlistentry>
120
195
<term><option>-x</option> <replaceable>extension</></term>
121
196
<listitem>
122
- <para>
197
+ <!--
198
+ <para>
123
199
When using the program as a standalone utility, provide an extension
124
200
that will be stripped from all file names before deciding if they
125
201
should be deleted. This is typically useful for cleaning up archives
126
202
that have been compressed during storage, and therefore have had an
127
203
extension added by the compression program. For example: <literal>-x
128
204
.gz</literal>.
129
205
</para>
206
+ -->
207
+ <para>
208
+ 当该程序用作单独的工具时,提供一个扩展,该扩展将在决定文件是否应该被删除之前,
209
+ 提取所有的文件名。这通常在清理在存储时已经压缩了的归档时是有用的,
210
+ 并且因此有一个由压缩程序添加的扩展。例如:<literal>-x.gz</literal>。
211
+ </para>
130
212
131
- <para>
213
+ <!--
214
+ <para>
132
215
Note that the
133
216
<filename>.backup</> file name passed to the program should not
134
217
include the extension.
135
218
</para>
219
+ -->
220
+ <para>
221
+ 请注意,传递到该程序的<filename>.backup</>文件名不应该包含该扩展。
222
+ </para>
136
223
</listitem>
137
224
</varlistentry>
138
225
139
226
<varlistentry>
140
227
<term><option>-?</></term>
141
228
<term><option>--help</></term>
142
229
<listitem>
143
- <para>
230
+ <!--
231
+ <para>
144
232
Show help about <application>pg_archivecleanup</application> command line
145
233
arguments, and exit.
146
234
</para>
235
+ -->
236
+ <para>
237
+ 显示关于<application>pg_archivecleanup</application>命令行参数的帮助信息,然后退出。
238
+ </para>
147
239
</listitem>
148
240
</varlistentry>
149
241
</variablelist>
150
242
</para>
151
243
</refsect1>
152
244
153
245
<refsect1>
154
- <title>Notes</title>
246
+ <!--
247
+ <title>Notes</title>
248
+ -->
249
+ <title>注意</title>
155
250
156
- <para>
251
+ <!--
252
+ <para>
157
253
<application>pg_archivecleanup</application> is designed to work with
158
254
<productname>PostgreSQL</> 8.0 and later when used as a standalone utility,
159
255
or with <productname>PostgreSQL</> 9.0 and later when used as an
160
256
archive cleanup command.
161
257
</para>
258
+ -->
259
+ <para>
260
+ 当用作单独的工具时,<application>pg_archivecleanup</application>
261
+ 是设计在<productname>PostgreSQL</> 8.0及更新的版本上使用的,
262
+ 或者用作归档清理命令时,用在<productname>PostgreSQL</> 9.0及更新的版本上。
263
+ </para>
162
264
163
- <para>
265
+ <!--
266
+ <para>
164
267
<application>pg_archivecleanup</application> is written in C and has an
165
268
easy-to-modify source code, with specifically designated sections to modify
166
269
for your own needs
167
270
</para>
271
+ -->
272
+ <para>
273
+ <application>pg_archivecleanup</application>是用C写的,有一个容易修改的源代码,
274
+ 有专门指定的部分用来修改以满足你自己的需要。
275
+ </para>
168
276
</refsect1>
169
277
170
278
<refsect1>
171
- <title>Examples</title>
279
+ <!--
280
+ <title>Examples</title>
281
+ -->
282
+ <title>例子</title>
172
283
173
- <para>On Linux or Unix systems, you might use:
284
+ <!--
285
+ <para>On Linux or Unix systems, you might use:
174
286
<programlisting>
175
287
archive_cleanup_command = 'pg_archivecleanup -d /mnt/standby/archive %r 2>>cleanup.log'
176
288
</programlisting>
@@ -179,30 +291,55 @@ archive_cleanup_command = 'pg_archivecleanup -d /mnt/standby/archive %r 2>>clean
179
291
but the files are local to the standby.
180
292
This will:
181
293
</para>
294
+ -->
295
+ <para>
296
+ 在Linux或Unix系统上,你可能使用:
297
+ <programlisting>
298
+ archive_cleanup_command = 'pg_archivecleanup -d /mnt/standby/archive %r 2>>cleanup.log'
299
+ </programlisting>
300
+ 这里的归档目录的物理位置在备用服务器上,所以<varname>archive_command</>
301
+ 是通过NFS访问它的,但是文件对于备用服务器是本地的。这将:
302
+ </para>
182
303
<itemizedlist>
183
304
<listitem>
184
- <para>
305
+ <!--
306
+ <para>
185
307
produce debugging output in <filename>cleanup.log</>
186
308
</para>
309
+ -->
310
+ <para>
311
+ 在<filename>cleanup.log</>中产生调试输出
312
+ </para>
187
313
</listitem>
188
314
<listitem>
189
- <para>
315
+ <!--
316
+ <para>
190
317
remove no-longer-needed files from the archive directory
191
318
</para>
319
+ -->
320
+ <para>
321
+ 从归档目录中移除不再需要的文件
322
+ </para>
192
323
</listitem>
193
324
</itemizedlist>
194
325
</refsect1>
195
326
196
327
<refsect1>
328
+ <!--
197
329
<title>Author</title>
330
+ -->
331
+ <title>作者</title>
198
332
199
- <para>
333
+ <para>
200
334
Simon Riggs <email>simon@2ndquadrant.com</email>
201
335
</para>
202
336
</refsect1>
203
337
204
338
<refsect1>
205
- <title>See Also</title>
339
+ <!--
340
+ <title>See Also</title>
341
+ -->
342
+ <title>又见</title>
206
343
207
344
<simplelist type="inline">
208
345
<member><xref linkend="pgstandby"></member>
0 commit comments