mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-09 14:33:17 +02:00
Show dashes if there isn't recovery time of a backup
This commit is contained in:
parent
bf2830bad5
commit
4cb028cd97
5
show.c
5
show.c
@ -189,13 +189,14 @@ show_backup_list(FILE *out, parray *backup_list)
|
|||||||
pgBackup *backup;
|
pgBackup *backup;
|
||||||
const char *modes[] = { "", "PAGE", "PTRACK", "FULL", "", "PAGE+STREAM", "PTRACK+STREAM", "FULL+STREAM"};
|
const char *modes[] = { "", "PAGE", "PTRACK", "FULL", "", "PAGE+STREAM", "PTRACK+STREAM", "FULL+STREAM"};
|
||||||
TimeLineID parent_tli;
|
TimeLineID parent_tli;
|
||||||
char timestamp[20];
|
char timestamp[20] = "----";
|
||||||
char duration[20] = "----";
|
char duration[20] = "----";
|
||||||
char data_bytes_str[10] = "----";
|
char data_bytes_str[10] = "----";
|
||||||
|
|
||||||
backup = parray_get(backup_list, i);
|
backup = parray_get(backup_list, i);
|
||||||
|
|
||||||
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
|
if (backup->recovery_time != (time_t) 0)
|
||||||
|
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
|
||||||
if (backup->end_time != (time_t) 0)
|
if (backup->end_time != (time_t) 0)
|
||||||
snprintf(duration, lengthof(duration), "%lum",
|
snprintf(duration, lengthof(duration), "%lum",
|
||||||
(backup->end_time - backup->start_time) / 60);
|
(backup->end_time - backup->start_time) / 60);
|
||||||
|
@ -19,17 +19,30 @@ def dir_files(base_dir):
|
|||||||
|
|
||||||
class ShowBackup(object):
|
class ShowBackup(object):
|
||||||
def __init__(self, split_line):
|
def __init__(self, split_line):
|
||||||
self.id = split_line[0]
|
self.counter = 0
|
||||||
|
|
||||||
|
self.id = self.get_inc(split_line)
|
||||||
# TODO: parse to datetime
|
# TODO: parse to datetime
|
||||||
self.recovery_time = "%s %s" % (split_line[1], split_line[2])
|
if len(split_line) == 10:
|
||||||
self.mode = split_line[3]
|
self.recovery_time = "%s %s" % (self.get_inc(split_line),
|
||||||
self.cur_tli = split_line[4]
|
self.get_inc(split_line))
|
||||||
self.parent_tli = split_line[6]
|
# if recovery time is '----'
|
||||||
|
else:
|
||||||
|
self.recovery_time = self.get_inc(split_line)
|
||||||
|
self.mode = self.get_inc(split_line)
|
||||||
|
self.cur_tli = self.get_inc(split_line)
|
||||||
|
# slash
|
||||||
|
self.counter += 1
|
||||||
|
self.parent_tli = self.get_inc(split_line)
|
||||||
# TODO: parse to interval
|
# TODO: parse to interval
|
||||||
self.time = split_line[7]
|
self.time = self.get_inc(split_line)
|
||||||
# TODO: maybe rename to size?
|
# TODO: maybe rename to size?
|
||||||
self.data = split_line[8]
|
self.data = self.get_inc(split_line)
|
||||||
self.status = split_line[9]
|
self.status = self.get_inc(split_line)
|
||||||
|
|
||||||
|
def get_inc(self, split_line):
|
||||||
|
self.counter += 1
|
||||||
|
return split_line[self.counter - 1]
|
||||||
|
|
||||||
|
|
||||||
class ProbackupTest(object):
|
class ProbackupTest(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user