Re: Command to prune archive at restartpoints - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Command to prune archive at restartpoints
Date
Msg-id 4C0ECD1E.1050709@dunslane.net
Whole thread Raw
In response to Re: Command to prune archive at restartpoints  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Idea for getting rid of VACUUM FREEZE on cold pages
Next
From: Robert Haas
Date:
Subject: Re: Idea for getting rid of VACUUM FREEZE on cold pages