Mozilla/mozilla/webtools/tinderbox3/scripts/tbox_recompress_logs.pl
johnkeis 672bdba50c Compress all the old logs
git-svn-id: svn://10.0.0.236/trunk@137363 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-04 09:43:24 +00:00

17 lines
357 B
Perl
Executable File

#!/usr/bin/perl -w -I.
use strict;
use Getopt::Long;
my %args;
$args{uncompressed_hours} = 24;
GetOptions(\%args, "uncompressed_hours:i");
foreach my $file (glob("xml/logs/*/*.log")) {
my @file_stat = stat($file);
my $file_mtime = $file_stat[9];
if ((time - $file_mtime) >= $args{uncompressed_hours}*60*60) {
system("gzip", "-9", $file);
}
}