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