9
9
*/
10
10
11
11
#include "pg_probackup.h"
12
+ #include <time.h>
12
13
13
14
static void show_backup_list (FILE * out , parray * backup_list );
14
15
static void show_backup_detail (FILE * out , pgBackup * backup );
@@ -188,9 +189,9 @@ show_backup_list(FILE *out, parray *backup_list)
188
189
int i ;
189
190
190
191
/* show header */
191
- fputs ("=========================================================================================================\n" , out );
192
- fputs ("ID Recovery time Mode Current/Parent TLI Time Data start_lsn stop_lsn Status \n" , out );
193
- fputs ("=========================================================================================================\n" , out );
192
+ fputs ("============================================================================================================= \n" , out );
193
+ fputs ("ID Recovery time Mode Current/Parent TLI Time Data start_lsn stop_lsn Status \n" , out );
194
+ fputs ("============================================================================================================= \n" , out );
194
195
195
196
for (i = 0 ; i < parray_num (backup_list ); i ++ )
196
197
{
@@ -204,8 +205,8 @@ show_backup_list(FILE *out, parray *backup_list)
204
205
if (backup -> recovery_time != (time_t ) 0 )
205
206
time2iso (timestamp , lengthof (timestamp ), backup -> recovery_time );
206
207
if (backup -> end_time != (time_t ) 0 )
207
- snprintf (duration , lengthof (duration ), "%lum" ,
208
- (backup -> end_time - backup -> start_time ) / 60 );
208
+ snprintf (duration , lengthof (duration ), "%.*lf s" , 0 ,
209
+ difftime (backup -> end_time , backup -> start_time ));
209
210
210
211
/*
211
212
* Calculate Data field, in the case of full backup this shows the
@@ -218,7 +219,7 @@ show_backup_list(FILE *out, parray *backup_list)
218
219
/* Get parent timeline before printing */
219
220
parent_tli = get_parent_tli (backup -> tli );
220
221
221
- fprintf (out , "%-8s %-19s %-13s %2d /%2d %5s %6s %X/%X %X/%X %s \n" ,
222
+ fprintf (out , "%-8s %-19s %-13s %2d /%2d %-10s %6s %X/%X %X/%X %s \n" ,
222
223
base36enc (backup -> start_time ),
223
224
timestamp ,
224
225
modes [backup -> backup_mode + (BACKUP_MODE_FULL + 1 )* backup -> stream ],
0 commit comments