Re: Command to prune archive at restartpoints

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Command to prune archive at restartpoints
Дата
Msg-id 4C0ECD1E.1050709@dunslane.net
обсуждение исходный текст
Ответ на Re: Command to prune archive at restartpoints  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

Tom Lane wrote:
> As for the language choice, my first thought is +1 for perl over shell,
> mainly because it might be directly useful to people on Windows while
> shell never would be.  On the other hand, if it's possible to do a
> useful one-liner in shell then let's do it that way.
>   

I don't think it is, reasonably. But here is fairly minimal version that 
might suit the docs:
   use strict;   my ($dir, $num) = @ARGV;   foreach my $file (glob("$dir/*"))   {           my $name = basename($file);
         unlink $file if (-f $file && $name =~ /^[0-9A-Z]{24}$/ && $name lt $num);   }     
 



cheers

andrew


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Idea for getting rid of VACUUM FREEZE on cold pages
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Idea for getting rid of VACUUM FREEZE on cold pages