wal-g: Update pg_backup_and_purge for wal-g format.

wal-g has a slihghtly different format than wal-e in its `backup-list`
output; it only contains three columns:
 - `name`
 - `last_modified`,
 - `wal_segment_backup_start`

..rather than wal-e's plethora, most of which were blank:
 - `name`
 - `last_modified`
 - `expanded_size_bytes`
 - `wal_segment_backup_start`
 - `wal_segment_offset_backup_start`
 - `wal_segment_backup_stop`
 - `wal_segment_offset_backup_stop`

Remove one argument from the split.
This commit is contained in:
Alex Vandiver
2020-06-29 15:58:58 -07:00
committed by Tim Abbott
parent 92f98292c1
commit a5d63cfedf

View File

@@ -56,7 +56,7 @@ backups: Dict[datetime, str] = {}
lines = run(['env-wal-g', 'backup-list']).split("\n")
for line in lines[1:]:
if line:
backup_name, date_str, _, _ = line.split()
backup_name, date_str, _ = line.split()
backups[dateutil.parser.parse(date_str)] = backup_name
one_month_ago = now - timedelta(days=30)