Skip to content

Commit c0b9b02

Browse files
committed
Fix docs and use recovery time for show command.
1 parent 9f2ad9d commit c0b9b02

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

doc/pg_arman.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ pg_arman [ OPTIONS ]
1010
{ init |
1111
backup |
1212
restore |
13-
show [ DATE | timeline ] |
14-
validate [ DATE ] |
15-
delete DATE }
13+
show [ ID] |
14+
validate [ ID ] |
15+
delete ID }
1616
```
1717

18-
DATE is the start time of the target backup in ISO-format:
19-
(YYYY-MM-DD HH:MI:SS). Prefix match is used to compare DATE and backup
20-
files.
18+
ID is the base36 id from start time of the target backup.
2119

2220
## DESCRIPTION
2321

@@ -139,12 +137,12 @@ $ pg_ctl start
139137
### SHOW A BACKUP
140138
```
141139
$ pg_arman show
142-
===================================================================================
143-
Start Mode Current TLI Parent TLI Time Data Backup Status
144-
===================================================================================
145-
2013-12-25 03:02:31 PAGE 1 0 0m 203kB 67MB DONE
146-
2013-12-25 03:02:31 PAGE 1 0 0m 0B 0B ERROR
147-
2013-12-25 03:02:25 FULL 1 0 0m 33MB 364MB OK
140+
==========================================================================================
141+
ID Recovery time Mode Current TLI Parent TLI Time Data Backup Status
142+
==========================================================================================
143+
OFX1LH 2013-12-25 03:02:31 PAGE 1 0 0m 203kB 67MB DONE
144+
OFX1KL 2013-12-25 03:02:31 PAGE 1 0 0m 0B 0B ERROR
145+
OFX1KA 2013-12-25 03:02:25 FULL 1 0 0m 33MB 364MB OK
148146
```
149147
The fields are:
150148

@@ -165,10 +163,10 @@ The fields are:
165163
* ERROR : backup is unavailable because some errors occur during backup.
166164
* CORRUPT : backup is unavailable because it is broken.
167165

168-
When a date is specified, more details about a backup is retrieved:
166+
When a ID is specified, more details about a backup is retrieved:
169167

170168
```
171-
$ pg_arman show '2011-11-27 19:15:45'
169+
$ pg_arman show OFX1LH
172170
# configuration
173171
BACKUP_MODE=FULL
174172
# result
@@ -189,7 +187,7 @@ You can check the "RECOVERY_XID" and "RECOVERY_TIME" which are used for
189187
restore option "--recovery-target-xid", "--recovery-target-time".
190188

191189
The delete command deletes backup files not required by recovery after
192-
the specified date. This command also cleans up in the WAL archive the
190+
the specified ID. This command also cleans up in the WAL archive the
193191
WAL segments that are no longer needed to restore from the remaining
194192
backups.
195193

expected/option.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Usage:
77
pg_arman OPTION init
88
pg_arman OPTION backup
99
pg_arman OPTION restore
10-
pg_arman OPTION show [DATE] [DATE]
11-
pg_arman OPTION validate [DATE] [DATE]
12-
pg_arman OPTION delete DATE
10+
pg_arman OPTION show [ID]
11+
pg_arman OPTION validate [ID]
12+
pg_arman OPTION delete ID
1313

1414
Common Options:
1515
-D, --pgdata=PATH location of the database storage area

pg_arman.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ pgut_help(bool details)
211211
printf(_(" %s OPTION init\n"), PROGRAM_NAME);
212212
printf(_(" %s OPTION backup\n"), PROGRAM_NAME);
213213
printf(_(" %s OPTION restore\n"), PROGRAM_NAME);
214-
printf(_(" %s OPTION show [DATE] [DATE]\n"), PROGRAM_NAME);
215-
printf(_(" %s OPTION validate [DATE] [DATE]\n"), PROGRAM_NAME);
216-
printf(_(" %s OPTION delete DATE\n"), PROGRAM_NAME);
214+
printf(_(" %s OPTION show [ID]\n"), PROGRAM_NAME);
215+
printf(_(" %s OPTION validate [ID]\n"), PROGRAM_NAME);
216+
printf(_(" %s OPTION delete ID\n"), PROGRAM_NAME);
217217

218218
if (!details)
219219
return;

show.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
166166

167167
/* show header */
168168
fputs("===================================================================================\n", out);
169-
fputs("ID Stop Mode Current TLI Parent TLI Time Data Status \n", out);
169+
fputs("ID Recovery time Mode Current TLI Parent TLI Time Data Status \n", out);
170170
fputs("===================================================================================\n", out);
171171

172172
for (i = 0; i < parray_num(backup_list); i++)
@@ -184,7 +184,7 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
184184
if (backup->status == BACKUP_STATUS_DELETED && !show_all)
185185
continue;
186186

187-
time2iso(timestamp, lengthof(timestamp), backup->end_time);
187+
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
188188
if (backup->end_time != (time_t) 0)
189189
snprintf(duration, lengthof(duration), "%lum",
190190
(backup->end_time - backup->start_time) / 60);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy