Compress all the old logs
git-svn-id: svn://10.0.0.236/trunk@137363 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
9b518d5d00
commit
672bdba50c
16
mozilla/webtools/tinderbox3/scripts/tbox_recompress_logs.pl
Executable file
16
mozilla/webtools/tinderbox3/scripts/tbox_recompress_logs.pl
Executable file
@ -0,0 +1,16 @@
|
||||
#!/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);
|
||||
}
|
||||
}
|
||||
16
mozilla/webtools/tinderbox3/server/tbox_recompress_logs.pl
Executable file
16
mozilla/webtools/tinderbox3/server/tbox_recompress_logs.pl
Executable file
@ -0,0 +1,16 @@
|
||||
#!/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);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user