@@ -37,6 +37,7 @@ static intkeep_data_days = KEEP_INFINITE;
3737int num_threads = 1 ;
3838bool stream_wal = false;
3939bool disable_ptrack_clear = false;
40+ static bool backup_logs = false;
4041static bool backup_validate = false;
4142
4243/* restore configuration */
@@ -60,9 +61,10 @@ static pgut_option options[] =
6061/* common options */
6162{'b' ,'c' ,"check" ,& check },
6263{'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 },
6565/* backup options */
66+ {'b' ,9 ,"disable-ptrack-clear" ,& disable_ptrack_clear },
67+ {'b' ,10 ,"backup-pg-log" ,& backup_logs },
6668{'f' ,'b' ,"backup-mode" ,opt_backup_mode ,SOURCE_ENV },
6769{'b' ,'C' ,"smooth-checkpoint" ,& smooth_checkpoint ,SOURCE_ENV },
6870/* options with only long name (keep-xxx) */
@@ -175,6 +177,9 @@ main(int argc, char *argv[])
175177if (arclog_path )
176178pgdata_exclude [i ++ ]= arclog_path ;
177179
180+ if (!backup_logs )
181+ pgdata_exclude [i ++ ]= "pg_log" ;
182+
178183/* do actual operation */
179184if (pg_strcasecmp (cmd ,"init" )== 0 )
180185return do_init ();
@@ -234,13 +239,14 @@ pgut_help(bool details)
234239printf (_ (" -c, --check show what would have been done\n" ));
235240printf (_ (" -j, --threads=NUM num threads for backup and restore\n" ));
236241printf (_ (" --stream use stream for save/restore WAL during backup\n" ));
237- printf (_ (" --disable-ptrack-clear disable clear ptrack for postgres without ptrack\n" ));
238242printf (_ ("\nBackup options:\n" ));
239243printf (_ (" -b, --backup-mode=MODE full,page,ptrack\n" ));
240244printf (_ (" -C, --smooth-checkpoint do smooth checkpoint before backup\n" ));
241245printf (_ (" --validate validate backup after taking it\n" ));
242246printf (_ (" --keep-data-generations=N keep GENERATION of full data backup\n" ));
243247printf (_ (" --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" ));
244250printf (_ ("\nRestore options:\n" ));
245251printf (_ (" --recovery-target-time time stamp up to which recovery will proceed\n" ));
246252printf (_ (" --recovery-target-xid transaction ID up to which recovery will proceed\n" ));