Exclude pg_log by default and add option for start beckup.

This commit is contained in:
stalkerg
2016-09-02 18:31:06 +03:00
parent 589d8ddf98
commit 3eb1013baa
3 changed files with 12 additions and 4 deletions
+1
View File
@@ -28,6 +28,7 @@ const char *pgdata_exclude[] =
NULL, /* arclog_path will be set later */
NULL, /* 'pg_tblspc' will be set later */
NULL, /* sentinel */
NULL
};
static pgFile *pgFileNew(const char *path, bool omit_symlink);
+2 -1
View File
@@ -18,7 +18,6 @@ Common Options:
-c, --check show what would have been done
-j, --threads=NUM num threads for backup and restore
--stream use stream for save/restore WAL during backup
--disable-ptrack-clear disable clear ptrack for postgres without ptrack
Backup options:
-b, --backup-mode=MODE full,page,ptrack
@@ -26,6 +25,8 @@ Backup options:
--validate validate backup after taking it
--keep-data-generations=N keep GENERATION of full data backup
--keep-data-days=DAY keep enough data backup to recover to DAY days age
--disable-ptrack-clear disable clear ptrack for postgres without ptrack
--backup-pg-log start backup pg_log directory
Restore options:
--recovery-target-time time stamp up to which recovery will proceed
+9 -3
View File
@@ -37,6 +37,7 @@ static int keep_data_days = KEEP_INFINITE;
int num_threads = 1;
bool stream_wal = false;
bool disable_ptrack_clear = false;
static bool backup_logs = false;
static bool backup_validate = false;
/* restore configuration */
@@ -60,9 +61,10 @@ static pgut_option options[] =
/* common options */
{ 'b', 'c', "check", &check },
{ 'i', 'j', "threads", &num_threads },
{ 'b', 8, "stream", &stream_wal },
{ 'b', 9, "disable-ptrack-clear", &disable_ptrack_clear },
{ 'b', 8, "stream", &stream_wal },
/* backup options */
{ 'b', 9, "disable-ptrack-clear", &disable_ptrack_clear },
{ 'b', 10, "backup-pg-log", &backup_logs },
{ 'f', 'b', "backup-mode", opt_backup_mode, SOURCE_ENV },
{ 'b', 'C', "smooth-checkpoint", &smooth_checkpoint, SOURCE_ENV },
/* options with only long name (keep-xxx) */
@@ -175,6 +177,9 @@ main(int argc, char *argv[])
if (arclog_path)
pgdata_exclude[i++] = arclog_path;
if(!backup_logs)
pgdata_exclude[i++] = "pg_log";
/* do actual operation */
if (pg_strcasecmp(cmd, "init") == 0)
return do_init();
@@ -234,13 +239,14 @@ pgut_help(bool details)
printf(_(" -c, --check show what would have been done\n"));
printf(_(" -j, --threads=NUM num threads for backup and restore\n"));
printf(_(" --stream use stream for save/restore WAL during backup\n"));
printf(_(" --disable-ptrack-clear disable clear ptrack for postgres without ptrack\n"));
printf(_("\nBackup options:\n"));
printf(_(" -b, --backup-mode=MODE full,page,ptrack\n"));
printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n"));
printf(_(" --validate validate backup after taking it\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(_(" --disable-ptrack-clear disable clear ptrack for postgres without ptrack\n"));
printf(_(" --backup-pg-log start backup pg_log directory\n"));
printf(_("\nRestore options:\n"));
printf(_(" --recovery-target-time time stamp up to which recovery will proceed\n"));
printf(_(" --recovery-target-xid transaction ID up to which recovery will proceed\n"));