html/logcompress.pl
1 # compress log files when they're rotated
2 # for irssi 0.7.99 by Timo Sirainen
3 use Irssi;
4 use vars qw($VERSION %IRSSI);
5 $VERSION = "0.01";
6 %IRSSI = (
7 authors => "Timo \'cras\' Sirainen",
8 contact => "tss\@iki.fi",
9 name => "logcompress",
10 description => "compress logfiles then they\'re rotated",
11 license => "Public Domain",
12 url => "http://irssi.org/",
13 changed => "2002-03-04T22:47+0100"
14 );
15
16
17 my $compressor = "bzip2 -9";
18
19 sub sig_rotate {
20 Irssi::command("exec - $compressor ".$_[0]->{real_fname});
21 }
22
23 Irssi::signal_add('log rotated', 'sig_rotate');