Allow pg_archivecleanup to remove backup history files

Поиск
Список
Период
Сортировка
От torikoshia
Тема Allow pg_archivecleanup to remove backup history files
Дата
Msg-id d660ef741ce3d82f3b4283f1cafd576c@oss.nttdata.com
обсуждение исходный текст
Ответы Re: Allow pg_archivecleanup to remove backup history files
Список pgsql-hackers
Hi,

Currently pg_archivecleanup doesn't remove backup history files even 
when they're older than oldestkeptwalfile.

Of course the size of backup history files are smaller than WAL files 
and they wouldn't consume much disk space, but a lot of backup history 
files(e.g. daily backup for years) whose backups data have been already 
removed are unnecessary and I would appreciate if pg_archivecleanup has 
an option to remove them.

Attached a PoC patch, which added new option -b to remove files 
including backup history files older than oldestkeptwalfile.

   $ ls archivedir
   000000010000000000000001                  000000010000000000000003  
000000010000000000000006
   000000010000000000000008
   000000010000000000000002                  000000010000000000000004  
000000010000000000000007
   000000010000000000000009
   000000010000000000000002.00000028.backup  000000010000000000000005
   000000010000000000000007.00000028.backup  
00000001000000000000000A.partial

   $ pg_archivecleanup -b archivedir 000000010000000000000009

   $ ls archivedir
   000000010000000000000009  00000001000000000000000A.partial

Any thoughts?

-- 
Regards,

--
Atsushi Torikoshi
NTT DATA CORPORATION
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: Add two missing tests in 035_standby_logical_decoding.pl
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: In-placre persistance change of a relation