diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
commit | 03929dac2a29664878d2c971648a4fe1fb698462 (patch) | |
tree | 02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/logcompress.pl | |
parent | Initial commit. (diff) | |
download | irssi-scripts-upstream/20231031.tar.xz irssi-scripts-upstream/20231031.zip |
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/logcompress.pl')
-rw-r--r-- | scripts/logcompress.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/logcompress.pl b/scripts/logcompress.pl new file mode 100644 index 0000000..39089c1 --- /dev/null +++ b/scripts/logcompress.pl @@ -0,0 +1,24 @@ +# compress log files when they're rotated +# for irssi 0.7.99 by Timo Sirainen +use strict; +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'); |