root/trunk/tools/generate_list_of_wal_segments.pl

Revision 166, 430 bytes (checked in by depesz, 4 years ago)

simple script to generate list of xlog files in given range.

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl -w
2 use strict;
3
4 my ( $from_file, $to_file ) = @ARGV;
5
6 die 'Bad range.' if $from_file gt $to_file;
7
8 my @from = map { hex $_ } $from_file =~ m{(.{8})(.{8})(.{8})};
9
10 while (1) {
11     print "$from_file\n" unless $from_file =~ m{FF\z};
12     last if $from_file eq $to_file;
13     $from[2]++;
14     if ($from[2] == 256) {
15         $from[2] = 0;
16         $from[1]++;
17     }
18     $from_file = sprintf '%08X%08X%08X', @from;
19 }
20
21 exit;
Note: See TracBrowser for help on using the browser.