1
- #pg_arman(1)
1
+ % PG_ARMAN(1)
2
+ % Michael Paquier, Yury Zhuravlev
3
+ % June 2016
2
4
3
- ## NAME
5
+ #NAME
4
6
5
7
pg_arman - Backup and recovery manager for PostgreSQL
6
8
7
- ## SYNOPSIS
9
+ #SYNOPSIS
8
10
```
9
11
pg_arman [ OPTIONS ]
10
12
{ init |
@@ -19,7 +21,7 @@ DATE is the start time of the target backup in ISO-format:
19
21
(YYYY-MM-DD HH:MI: SS ). Prefix match is used to compare DATE and backup
20
22
files.
21
23
22
- ## DESCRIPTION
24
+ #DESCRIPTION
23
25
24
26
pg_arman is a utility program to backup and restore PostgreSQL database.
25
27
@@ -32,7 +34,7 @@ It proposes the following features:
32
34
- Support for full and differential backup + ptrack differential backup
33
35
- Management of backups with integrated catalog
34
36
35
- ## COMMANDS
37
+ #COMMANDS
36
38
37
39
pg_arman supports the following commands. See also** OPTIONS** for more
38
40
details.
@@ -55,7 +57,7 @@ details.
55
57
* ** delete** :
56
58
Delete backup files.
57
59
58
- ### INITIALIZATION
60
+ ##INITIALIZATION
59
61
60
62
First, you need to create "a backup catalog" to store backup files and
61
63
their metadata. It is recommended to setup archive_mode and archive_command
@@ -68,7 +70,7 @@ specify it in PGDATA environmental variable or -D/--pgdata option.
68
70
$ pg_arman init -B /path/to/backup/
69
71
```
70
72
71
- ### BACKUP
73
+ ##BACKUP
72
74
73
75
Backup target can be one of the following types:
74
76
@@ -85,7 +87,7 @@ For use it you need set ptrack_enable option to "on".
85
87
It is recommended to verify backup files as soon as possible after backup.
86
88
Unverified backup cannot be used in restore and in differential backups.
87
89
88
- ### RESTORE
90
+ ##RESTORE
89
91
90
92
PostgreSQL server should be stopped before performing a restore. If database
91
93
cluster still exists, restore command will save unarchived transaction log
@@ -103,7 +105,7 @@ target. If pg_control is not present, TimeLineID in the full backup used by
103
105
the restore will be a restore target.
104
106
105
107
106
- ### EXAMPLES
108
+ ##EXAMPLES
107
109
108
110
To reduce the number of command line arguments, you can set BACKUP_PATH,
109
111
an environment variable, to the absolute path of the backup catalog and
@@ -117,7 +119,7 @@ KEEP_DATA_GENERATIONS = 3
117
119
KEEP_DATA_DAYS = 120
118
120
```
119
121
120
- ### TAKE A BACKUP
122
+ ##TAKE A BACKUP
121
123
122
124
This example takes a full backup of the whole database. Then, it validates
123
125
all unvalidated backups.
@@ -126,7 +128,7 @@ $ pg_arman backup --backup-mode=full
126
128
$ pg_arman validate
127
129
```
128
130
129
- ### RESTORE FROM A BACKUP
131
+ ##RESTORE FROM A BACKUP
130
132
131
133
Here are some commands to restore from a backup:
132
134
@@ -136,7 +138,7 @@ $ pg_arman restore
136
138
$ pg_ctl start
137
139
```
138
140
139
- ### SHOW A BACKUP
141
+ ##SHOW A BACKUP
140
142
```
141
143
$ pg_arman show
142
144
===================================================================================
@@ -193,13 +195,13 @@ the specified date. This command also cleans up in the WAL archive the
193
195
WAL segments that are no longer needed to restore from the remaining
194
196
backups.
195
197
196
- ### OPTIONS
198
+ ##OPTIONS
197
199
198
200
pg_arman accepts the following command line parameters. Some of them can
199
201
be also specified as environment variables. See also* PARAMETERS* for the
200
202
details.
201
203
202
- ### COMMON OPTIONS
204
+ ##COMMON OPTIONS
203
205
As a general rule, paths for data location need to be specified as
204
206
absolute paths; relative paths are not allowed.
205
207
@@ -219,7 +221,7 @@ absolute paths; relative paths are not allowed.
219
221
parameters and required resources. The option is typically used with
220
222
--verbose option to verify the operation.
221
223
222
- ### BACKUP OPTIONS
224
+ ##BACKUP OPTIONS
223
225
224
226
** -b** BACKUPMODE /** --backup-mode** =BACKUPMODE:
225
227
Specify backup target files. Available options are: "full",
@@ -246,7 +248,7 @@ absolute paths; relative paths are not allowed.
246
248
** --stream** :
247
249
Enable stream replication for save WAL during backup process.
248
250
249
- ### RESTORE OPTIONS
251
+ ##RESTORE OPTIONS
250
252
251
253
The parameters whose name start are started with --recovery refer to
252
254
the same parameters as the ones in recovery.confin recovery.conf.
@@ -274,12 +276,13 @@ the same parameters as the ones in recovery.confin recovery.conf.
274
276
backup with** --stream** option. This option will disable all** --recovery-**
275
277
options.
276
278
277
- ### CATALOG OPTIONS
279
+ ##CATALOG OPTIONS
278
280
279
281
** -a** /** --show-all** :
280
282
Show all existing backups, including the deleted ones.
281
283
282
- ###CONNECTION OPTIONS
284
+ ##CONNECTION OPTIONS
285
+
283
286
Parameters to connect PostgreSQL server.
284
287
285
288
** -d** DBNAME /** --dbname** =DBNAME:
@@ -312,7 +315,7 @@ Parameters to connect PostgreSQL server.
312
315
if the server wants a password. In some cases it is worth typing -W
313
316
to avoid the extra connection attempt.
314
317
315
- ### GLOBAL OPTIONS
318
+ ##GLOBAL OPTIONS
316
319
317
320
** --help** :
318
321
Print help, then exit.
@@ -323,7 +326,7 @@ Parameters to connect PostgreSQL server.
323
326
** -v** /** --verbose** :
324
327
If specified, pg_arman works in verbose mode.
325
328
326
- ## PARAMETERS
329
+ #PARAMETERS
327
330
328
331
Some of parameters can be specified as command line arguments, environment
329
332
variables or in configuration file as follows:
@@ -357,7 +360,7 @@ line and configuration file for security reason.
357
360
This utility, like most other PostgreSQL utilities, also uses the
358
361
environment variables supported by libpq (see Environment Variables).
359
362
360
- ## RESTRICTIONS
363
+ #RESTRICTIONS
361
364
362
365
pg_arman has the following restrictions.
363
366
@@ -370,29 +373,29 @@ pg_arman has the following restrictions.
370
373
WAL directory or archived WAL directory, the backup or restore will fail
371
374
depending on the backup mode selected.
372
375
373
- ## DETAILS
376
+ #DETAILS
374
377
375
- ### RECOVERY TO POINT-IN-TIME
378
+ ##RECOVERY TO POINT-IN-TIME
376
379
pg_arman can recover to point-in-time if timeline, transaction ID, or
377
380
timestamp is specified in recovery.conf. xlogdump is a contrib module of
378
381
PostgreSQL core that allows checking in the content of WAL files and
379
382
determine when to recover. This might help.
380
383
381
- ### CONFIGURATION FILE
384
+ ##CONFIGURATION FILE
382
385
Setting parameters in configuration file is done as "name=value". Quotes
383
386
are required if the value contains whitespaces. Comments should start with
384
387
"#" and are automatically ignored. Whitespaces and tabs are ignored
385
388
excluding values.
386
389
387
- ### RESTRICTIONS
390
+ ##RESTRICTIONS
388
391
* In order to work, the PostgreSQL instance on which backups are taken need
389
392
to have data checksums enabled or to enable wal_log_hints.
390
393
* pg_arman is aimed at working with PostgreSQL 9.5 and newer versions.
391
394
* For ptrack feature you need special version of Postgres and set wal_level to
392
395
archive or hot_standby and ptrack_enable.
393
396
* For stream feature you need configure streaming replication in your postgres.
394
397
395
- ### EXIT CODE
398
+ ##EXIT CODE
396
399
pg_arman returns exit codes for each error status.
397
400
398
401
```
@@ -403,7 +406,7 @@ Code Name Description
403
406
3 PANIC Unknown critical condition
404
407
```
405
408
406
- ## AUTHOR ##
409
+ #AUTHORS
407
410
pg_arman is a fork of pg_arman that was originally written by NTT, now
408
411
developed and maintained by Michael Paquier.
409
412
Threads, WAL diff, ptrack diff, stream WAL and some other features developed by