1
- = pg_arman(1)=
1
+ # pg_arman(1)
2
2
3
- == NAME==
3
+ ## NAME
4
4
5
5
pg_arman - Backup and recovery manager for PostgreSQL
6
6
7
- == SYNOPSIS==
7
+ ## SYNOPSIS
8
8
9
9
pg_arman[ OPTIONS]
10
10
{ init |
@@ -18,7 +18,7 @@ DATE is the start time of the target backup in ISO-format:
18
18
(YYYY-MM-DD HH:MI: SS ). Prefix match is used to compare DATE and backup
19
19
files.
20
20
21
- == DESCRIPTION==
21
+ ## DESCRIPTION
22
22
23
23
pg_arman is a utility program to backup and restore PostgreSQL database.
24
24
@@ -31,7 +31,7 @@ It proposes the following features:
31
31
- Support for full and differential backup
32
32
- Management of backups with integrated catalog
33
33
34
- == COMMANDS==
34
+ ## COMMANDS
35
35
36
36
pg_arman supports the following commands. See also* OPTIONS* for more
37
37
details.
@@ -55,7 +55,7 @@ details.
55
55
* delete* ::
56
56
Delete backup files.
57
57
58
- === INITIALIZATION===
58
+ ### INITIALIZATION
59
59
60
60
First, you need to create "a backup catalog" to store backup files and
61
61
their metadata. It is recommended to setup archive_mode and archive_command
@@ -66,7 +66,7 @@ specify it in PGDATA environmental variable or -D/--pgdata option.
66
66
67
67
$ pg_arman init -B /path/to/backup/
68
68
69
- === BACKUP===
69
+ ### BACKUP
70
70
71
71
Backup target can be one of the following types:
72
72
@@ -81,7 +81,7 @@ has been run needs to be forcibly switched.
81
81
It is recommended to verify backup files as soon as possible after backup.
82
82
Unverified backup cannot be used in restore and in differential backup.
83
83
84
- === RESTORE===
84
+ ### RESTORE
85
85
86
86
PostgreSQL server should be stopped before performing a restore. If database
87
87
cluster still exists, restore command will save unarchived transaction log
@@ -99,7 +99,7 @@ target. If pg_control is not present, TimeLineID in the full backup used by
99
99
the restore will be a restore target.
100
100
101
101
102
- == EXAMPLES==
102
+ ### EXAMPLES
103
103
104
104
To reduce the number of command line arguments, you can set BACKUP_PATH,
105
105
an environment variable, to the absolute path of the backup catalog and
@@ -111,32 +111,32 @@ write default configuration into ${BACKUP_PATH}/pg_arman.ini.
111
111
KEEP_DATA_GENERATIONS = 3
112
112
KEEP_DATA_DAYS = 120
113
113
114
- === TAKE A BACKUP===
114
+ ### TAKE A BACKUP
115
115
116
116
This example takes a full backup of the whole database. Then, it validates
117
117
all unvalidated backups.
118
118
119
119
$ pg_arman backup --backup-mode=full
120
120
$ pg_arman validate
121
121
122
- === RESTORE FROM A BACKUP===
122
+ ### RESTORE FROM A BACKUP
123
123
124
124
Here are some commands to restore from a backup:
125
125
126
126
$ pg_ctl stop -m immediate
127
127
$ pg_arman restore
128
128
$ pg_ctl start
129
129
130
- === SHOW A BACKUP===
131
-
130
+ ### SHOW A BACKUP
131
+ ```
132
132
$ pg_arman show
133
133
===================================================================================
134
134
Start Mode Current TLI Parent TLI Time Data Backup Status
135
135
===================================================================================
136
136
2013-12-25 03:02:31 PAGE 1 0 0m 203kB 67MB DONE
137
137
2013-12-25 03:02:31 PAGE 1 0 0m 0B 0B ERROR
138
138
2013-12-25 03:02:25 FULL 1 0 0m 33MB 364MB OK
139
-
139
+ ```
140
140
The fields are:
141
141
142
142
* Start: start time of backup
@@ -182,13 +182,13 @@ the specified date. This command also cleans up in the WAL archive the
182
182
WAL segments that are no longer needed to restore from the remaining
183
183
backups.
184
184
185
- == OPTIONS==
185
+ ### OPTIONS
186
186
187
187
pg_arman accepts the following command line parameters. Some of them can
188
188
be also specified as environment variables. See also* PARAMETERS* for the
189
189
details.
190
190
191
- === COMMON OPTIONS===
191
+ ### COMMON OPTIONS
192
192
As a general rule, paths for data location need to be specified as
193
193
absolute paths; relative paths are not allowed.
194
194
@@ -229,7 +229,7 @@ absolute paths; relative paths are not allowed.
229
229
--keep-data-days means days to be kept.
230
230
Only files exceeded one of those settings are deleted.
231
231
232
- === RESTORE OPTIONS===
232
+ ### RESTORE OPTIONS
233
233
234
234
The parameters whose name start are started with --recovery refer to
235
235
the same parameters as the ones in recovery.confin recovery.conf.
@@ -254,7 +254,7 @@ the same parameters as the ones in recovery.confin recovery.conf.
254
254
* -a* /* --show-all* ::
255
255
Show all existing backups, including the deleted ones.
256
256
257
- === CONNECTION OPTIONS===
257
+ ### CONNECTION OPTIONS
258
258
Parameters to connect PostgreSQL server.
259
259
260
260
* -d* _ DBNAME_ /* --dbname* =_ DBNAME_ ::
@@ -287,7 +287,7 @@ Parameters to connect PostgreSQL server.
287
287
if the server wants a password. In some cases it is worth typing -W
288
288
to avoid the extra connection attempt.
289
289
290
- === GLOBAL OPTIONS===
290
+ ### GLOBAL OPTIONS
291
291
292
292
* --help* ::
293
293
Print help, then exit.
@@ -298,7 +298,7 @@ Parameters to connect PostgreSQL server.
298
298
* -v* /* --verbose* ::
299
299
If specified, pg_arman works in verbose mode.
300
300
301
- == PARAMETERS==
301
+ ## PARAMETERS
302
302
303
303
Some of parameters can be specified as command line arguments, environment
304
304
variables or in configuration file as follows:
@@ -331,7 +331,7 @@ line and configuration file for security reason.
331
331
This utility, like most other PostgreSQL utilities, also uses the
332
332
environment variables supported by libpq (see Environment Variables).
333
333
334
- == RESTRICTIONS==
334
+ ## RESTRICTIONS ##
335
335
336
336
pg_arman has the following restrictions.
337
337
@@ -344,26 +344,26 @@ pg_arman has the following restrictions.
344
344
WAL directory or archived WAL directory, the backup or restore will fail
345
345
depending on the backup mode selected.
346
346
347
- == DETAILS==
347
+ ## DETAILS ##
348
348
349
- === RECOVERY TO POINT-IN-TIME===
349
+ ### RECOVERY TO POINT-IN-TIME
350
350
pg_arman can recover to point-in-time if timeline, transaction ID, or
351
351
timestamp is specified in recovery.conf. xlogdump is a contrib module of
352
352
PostgreSQL core that allows checking in the content of WAL files and
353
353
determine when to recover. This might help.
354
354
355
- === CONFIGURATION FILE===
355
+ ### CONFIGURATION FILE
356
356
Setting parameters in configuration file is done as "name=value". Quotes
357
357
are required if the value contains whitespaces. Comments should start with
358
358
"#" and are automatically ignored. Whitespaces and tabs are ignored
359
359
excluding values.
360
360
361
- === Restrictions===
361
+ ### Restrictions
362
362
In order to work, the PostgreSQL instance on which backups are taken need
363
363
to have data checksums enabled or to enable wal_log_hints. pg_arman is
364
364
aimed at working with PostgreSQL 9.5 and newer versions.
365
365
366
- === EXIT CODE===
366
+ ### EXIT CODE
367
367
pg_arman returns exit codes for each error status.
368
368
369
369
CodeNameDescription
@@ -372,7 +372,7 @@ pg_arman returns exit codes for each error status.
372
372
2FATALExit because of repeated errors
373
373
3PANICUnknown critical condition
374
374
375
- == AUTHOR==
375
+ ## AUTHOR ##
376
376
pg_arman is a fork of pg_arman that was originally written by NTT, now
377
377
developed and maintained by Michael Paquier.
378
378