diff options
| author | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
|---|---|---|
| committer | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
| commit | 2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1 (patch) | |
| tree | 1c5e6d817c88e67b46e216a50e0aef5428bf63df /scripts/logcompress.pl | |
| parent | 2d080422d79d1fd49d6c5528593ccaaff9bfc583 (diff) | |
| download | scripts.irssi.org-2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1.tar.bz2 | |
Import scripts from scripts.irssi.org
Diffstat (limited to 'scripts/logcompress.pl')
| -rw-r--r-- | scripts/logcompress.pl | 23 | 
1 files changed, 23 insertions, 0 deletions
| diff --git a/scripts/logcompress.pl b/scripts/logcompress.pl new file mode 100644 index 0000000..6d41362 --- /dev/null +++ b/scripts/logcompress.pl @@ -0,0 +1,23 @@ +# compress log files when they're rotated +# for irssi 0.7.99 by Timo Sirainen +use Irssi; +use vars qw($VERSION %IRSSI);  +$VERSION = "0.01"; +%IRSSI = ( +    authors	=> "Timo \'cras\' Sirainen", +    contact	=> "tss\@iki.fi",  +    name	=> "logcompress", +    description	=> "compress logfiles then they\'re rotated", +    license	=> "Public Domain", +    url		=> "http://irssi.org/", +    changed	=> "2002-03-04T22:47+0100"
 +); + + +my $compressor = "bzip2 -9"; + +sub sig_rotate { +        Irssi::command("exec - $compressor ".$_[0]->{real_fname}); +} + +Irssi::signal_add('log rotated', 'sig_rotate'); | 
