@@ -37,6 +37,7 @@ static intkeep_data_days = KEEP_INFINITE;
37
37
int num_threads = 1 ;
38
38
bool stream_wal = false;
39
39
bool disable_ptrack_clear = false;
40
+ static bool backup_logs = false;
40
41
static bool backup_validate = false;
41
42
42
43
/* restore configuration */
@@ -60,9 +61,10 @@ static pgut_option options[] =
60
61
/* common options */
61
62
{'b' ,'c' ,"check" ,& check },
62
63
{'i' ,'j' ,"threads" ,& num_threads },
63
- {'b' ,8 ,"stream" ,& stream_wal },
64
- {'b' ,9 ,"disable-ptrack-clear" ,& disable_ptrack_clear },
64
+ {'b' ,8 ,"stream" ,& stream_wal },
65
65
/* backup options */
66
+ {'b' ,9 ,"disable-ptrack-clear" ,& disable_ptrack_clear },
67
+ {'b' ,10 ,"backup-pg-log" ,& backup_logs },
66
68
{'f' ,'b' ,"backup-mode" ,opt_backup_mode ,SOURCE_ENV },
67
69
{'b' ,'C' ,"smooth-checkpoint" ,& smooth_checkpoint ,SOURCE_ENV },
68
70
/* options with only long name (keep-xxx) */
@@ -175,6 +177,9 @@ main(int argc, char *argv[])
175
177
if (arclog_path )
176
178
pgdata_exclude [i ++ ]= arclog_path ;
177
179
180
+ if (!backup_logs )
181
+ pgdata_exclude [i ++ ]= "pg_log" ;
182
+
178
183
/* do actual operation */
179
184
if (pg_strcasecmp (cmd ,"init" )== 0 )
180
185
return do_init ();
@@ -234,13 +239,14 @@ pgut_help(bool details)
234
239
printf (_ (" -c, --check show what would have been done\n" ));
235
240
printf (_ (" -j, --threads=NUM num threads for backup and restore\n" ));
236
241
printf (_ (" --stream use stream for save/restore WAL during backup\n" ));
237
- printf (_ (" --disable-ptrack-clear disable clear ptrack for postgres without ptrack\n" ));
238
242
printf (_ ("\nBackup options:\n" ));
239
243
printf (_ (" -b, --backup-mode=MODE full,page,ptrack\n" ));
240
244
printf (_ (" -C, --smooth-checkpoint do smooth checkpoint before backup\n" ));
241
245
printf (_ (" --validate validate backup after taking it\n" ));
242
246
printf (_ (" --keep-data-generations=N keep GENERATION of full data backup\n" ));
243
247
printf (_ (" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n" ));
248
+ printf (_ (" --disable-ptrack-clear disable clear ptrack for postgres without ptrack\n" ));
249
+ printf (_ (" --backup-pg-log start backup pg_log directory\n" ));
244
250
printf (_ ("\nRestore options:\n" ));
245
251
printf (_ (" --recovery-target-time time stamp up to which recovery will proceed\n" ));
246
252
printf (_ (" --recovery-target-xid transaction ID up to which recovery will proceed\n" ));