Changeset 238 for trunk

Show
Ignore:
Timestamp:
05/09/11 21:02:39 (3 years ago)
Author:
denish
Message:

Allow postgresql log files reading beyond yy-dd-dd, fixing regex errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pg_log/pg_log_monitor.pl

    r48 r238  
    1 #!/data/bin/perl 
     1#!/usr/bin/perl 
    22 
    33#Performs initial script configuration. Must be executed within BEGIN 
     
    102102   #Populate array of all logfile path names, sorted in descending order 
    103103    opendir(FH, $directory); 
    104       my @file_list = grep(/^postgresql-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.log$/, readdir(FH)); 
     104      my @file_list = grep(/^postgresql.*\.log$/, readdir(FH)); 
    105105    closedir(FH); 
    106106     
     
    525525my $data_string = shift;  
    526526 
    527 $data_string =~ s/([\$\.\"\'\(\)\|\*])/\\$1/g; 
     527$data_string =~ s/([\$\.\"\'\(\)\|\*\[\]])/\\$1/g; 
    528528 
    529529return $data_string;