1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-26 22:20:10 +02:00

Correct help texts.

This commit is contained in:
stalkerg 2016-11-16 21:32:26 +03:00
parent 37da8b080a
commit 6c94ea7fb1
5 changed files with 50 additions and 60 deletions

View File

@ -4,38 +4,37 @@
pg_probackup manage backup/recovery of PostgreSQL database.
Usage:
pg_probackup OPTION init
pg_probackup OPTION backup
pg_probackup OPTION restore
pg_probackup OPTION show [ID]
pg_probackup OPTION validate [ID]
pg_probackup OPTION delete ID
pg_probackup OPTION delwal [ID]
pg_probackup [option...] init
pg_probackup [option...] backup
pg_probackup [option...] restore
pg_probackup [option...] show [backup-ID]
pg_probackup [option...] validate [backup-ID]
pg_probackup [option...] delete backup-ID
pg_probackup [option...] delwal [backup-ID]
Common Options:
-D, --pgdata=PATH location of the database storage area
-B, --backup-path=PATH location of the backup storage area
-j, --threads=NUM num threads for backup and restore
--progress show progress copy files
-D, --pgdata=PATH location of the database storage area
Backup options:
-b, --backup-mode=MODE full,page,ptrack
-b, --backup-mode=MODE backup mode (full, page, ptrack)
-C, --smooth-checkpoint do smooth checkpoint before backup
--stream use stream for save/restore WAL during backup
--backup-pg-log start backup pg_log directory
--stream stream the transaction log and include it in the backup
-S, --slot=SLOTNAME replication slot to use
--backup-pg-log backup of pg_log directory
-j, --threads=NUM number of parallel threads
--progress show progress
Restore options:
--time time stamp up to which recovery will proceed
--xid transaction ID up to which recovery will proceed
--inclusive whether we stop just after the recovery target
--timeline recovering into a particular timeline
Catalog options:
-a, --show-all show deleted backup too
--time time stamp up to which recovery will proceed
--xid transaction ID up to which recovery will proceed
--inclusive whether we stop just after the recovery target
--timeline recovering into a particular timeline
-j, --threads=NUM number of parallel threads
--progress show progress
Delete options:
--wal remove unnecessary wal archives also
--wal remove unnecessary wal files
Connection options:
-d, --dbname=DBNAME database to connect
@ -48,8 +47,8 @@ Connection options:
Generic options:
-q, --quiet don't write any messages
-v, --verbose verbose mode
--help show this help, then exit
--version output version information, then exit
--help show this help, then exit
--version output version information and exit
Read the website for details. <https://github.com/postgrespro/pg_probackup>
Report bugs to <https://github.com/postgrespro/pg_probackup/issues>.

View File

@ -47,9 +47,6 @@ static char *target_xid;
static char *target_inclusive;
static TimeLineID target_tli;
/* show configuration */
static bool show_all = false;
static void opt_backup_mode(pgut_option *opt, const char *arg);
static pgut_option options[] =
@ -75,8 +72,6 @@ static pgut_option options[] =
{ 's', 4, "xid", &target_xid, SOURCE_ENV },
{ 's', 5, "inclusive", &target_inclusive, SOURCE_ENV },
{ 'u', 6, "timeline", &target_tli, SOURCE_ENV },
/* catalog options */
{ 'b', 'a', "show-all", &show_all },
/* delete options */
{ 'b', 12, "wal", &delete_wal },
{ 0 }
@ -205,7 +200,7 @@ main(int argc, char *argv[])
return do_restore(backup_id, target_time, target_xid,
target_inclusive, target_tli);
else if (pg_strcasecmp(cmd, "show") == 0)
return do_show(backup_id, show_all);
return do_show(backup_id);
else if (pg_strcasecmp(cmd, "validate") == 0)
return do_validate(backup_id);
else if (pg_strcasecmp(cmd, "delete") == 0)
@ -223,40 +218,40 @@ pgut_help(bool details)
{
printf(_("%s manage backup/recovery of PostgreSQL database.\n\n"), PROGRAM_NAME);
printf(_("Usage:\n"));
printf(_(" %s OPTION init\n"), PROGRAM_NAME);
printf(_(" %s OPTION backup\n"), PROGRAM_NAME);
printf(_(" %s OPTION restore\n"), PROGRAM_NAME);
printf(_(" %s OPTION show [ID]\n"), PROGRAM_NAME);
printf(_(" %s OPTION validate [ID]\n"), PROGRAM_NAME);
printf(_(" %s OPTION delete ID\n"), PROGRAM_NAME);
printf(_(" %s OPTION delwal [ID]\n"), PROGRAM_NAME);
printf(_(" %s [option...] init\n"), PROGRAM_NAME);
printf(_(" %s [option...] backup\n"), PROGRAM_NAME);
printf(_(" %s [option...] restore\n"), PROGRAM_NAME);
printf(_(" %s [option...] show [backup-ID]\n"), PROGRAM_NAME);
printf(_(" %s [option...] validate [backup-ID]\n"), PROGRAM_NAME);
printf(_(" %s [option...] delete backup-ID\n"), PROGRAM_NAME);
printf(_(" %s [option...] delwal [backup-ID]\n"), PROGRAM_NAME);
if (!details)
return;
printf(_("\nCommon Options:\n"));
printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
printf(_(" -B, --backup-path=PATH location of the backup storage area\n"));
printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
/*printf(_(" -c, --check show what would have been done\n"));*/
printf(_(" -j, --threads=NUM num threads for backup and restore\n"));
printf(_(" --progress show progress copy files\n"));
printf(_("\nBackup options:\n"));
printf(_(" -b, --backup-mode=MODE full,page,ptrack\n"));
printf(_(" -b, --backup-mode=MODE backup mode (full, page, ptrack)\n"));
printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n"));
printf(_(" --stream use stream for save/restore WAL during backup\n"));
printf(_(" --stream stream the transaction log and include it in the backup\n"));
/*printf(_(" --keep-data-generations=N keep GENERATION of full data backup\n"));
printf(_(" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n"));*/
printf(_(" --backup-pg-log start backup pg_log directory\n"));
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
printf(_(" --backup-pg-log backup of pg_log directory\n"));
printf(_(" -j, --threads=NUM number of parallel threads\n"));
printf(_(" --progress show progress\n"));
printf(_("\nRestore options:\n"));
printf(_(" --time time stamp up to which recovery will proceed\n"));
printf(_(" --xid transaction ID up to which recovery will proceed\n"));
printf(_(" --inclusive whether we stop just after the recovery target\n"));
printf(_(" --timeline recovering into a particular timeline\n"));
printf(_("\nCatalog options:\n"));
printf(_(" -a, --show-all show deleted backup too\n"));
printf(_(" --time time stamp up to which recovery will proceed\n"));
printf(_(" --xid transaction ID up to which recovery will proceed\n"));
printf(_(" --inclusive whether we stop just after the recovery target\n"));
printf(_(" --timeline recovering into a particular timeline\n"));
printf(_(" -j, --threads=NUM number of parallel threads\n"));
printf(_(" --progress show progress\n"));
printf(_("\nDelete options:\n"));
printf(_(" --wal remove unnecessary wal archives also\n"));
printf(_(" --wal remove unnecessary wal files\n"));
}
static void

View File

@ -225,7 +225,7 @@ extern int do_restore(time_t backup_id,
extern int do_init(void);
/* in show.c */
extern int do_show(time_t backup_id, bool show_all);
extern int do_show(time_t backup_id);
/* in delete.c */
extern int do_delete(time_t backup_id);

View File

@ -1453,8 +1453,8 @@ help(bool details)
printf(" -q, --quiet don't write any messages\n");
printf(" -v, --verbose verbose mode\n");
}
printf(" --help show this help, then exit\n");
printf(" --version output version information, then exit\n");
printf(" --help show this help, then exit\n");
printf(" --version output version information and exit\n");
if (details && (PROGRAM_URL || PROGRAM_EMAIL))
{

12
show.c
View File

@ -9,7 +9,7 @@
#include "pg_probackup.h"
static void show_backup_list(FILE *out, parray *backup_list, bool show_all);
static void show_backup_list(FILE *out, parray *backup_list);
static void show_backup_detail(FILE *out, pgBackup *backup);
/*
@ -18,7 +18,7 @@ static void show_backup_detail(FILE *out, pgBackup *backup);
* backup indicated by id.
*/
int
do_show(time_t backup_id, bool show_all)
do_show(time_t backup_id)
{
/*
* Safety check for archive folder, this is necessary to fetch
@ -52,7 +52,7 @@ do_show(time_t backup_id, bool show_all)
if (backup_list == NULL)
elog(ERROR, "can't process any more.");
show_backup_list(stdout, backup_list, show_all);
show_backup_list(stdout, backup_list);
/* cleanup */
parray_walk(backup_list, pgBackupFree);
@ -160,7 +160,7 @@ get_parent_tli(TimeLineID child_tli)
}
static void
show_backup_list(FILE *out, parray *backup_list, bool show_all)
show_backup_list(FILE *out, parray *backup_list)
{
int i;
@ -180,10 +180,6 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
backup = parray_get(backup_list, i);
/* skip deleted backup */
if (backup->status == BACKUP_STATUS_DELETED && !show_all)
continue;
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
if (backup->end_time != (time_t) 0)
snprintf(duration, lengthof(duration), "%lum",