diff options
| author | wilk | 2017-03-11 21:37:51 +0100 |
|---|---|---|
| committer | GitHub | 2017-03-11 21:37:51 +0100 |
| commit | ddf111c5a04753981ffcddc9af1f16608b2518cc (patch) | |
| tree | 029c3f0a6c34eb008c0087eb5cda7b90b4c23d87 /scripts/logcompress_perl.pl | |
| parent | ba002c7c1711c2ecd8228f09bc12928d53e82799 (diff) | |
| parent | 7d56ba19ec8048a9135aab37aac0d337224ed38b (diff) | |
| download | scripts.irssi.org-ddf111c5a04753981ffcddc9af1f16608b2518cc.tar.bz2 | |
Merge pull request #3 from wilkowy/master
Resync with master.
Diffstat (limited to 'scripts/logcompress_perl.pl')
| -rw-r--r-- | scripts/logcompress_perl.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/logcompress_perl.pl b/scripts/logcompress_perl.pl index 062331e..d75755a 100644 --- a/scripts/logcompress_perl.pl +++ b/scripts/logcompress_perl.pl @@ -4,7 +4,7 @@ use Irssi; use IO::Compress::Gzip qw(gzip $GzipError); use vars qw($VERSION %IRSSI); -$VERSION = "0.01"; +$VERSION = "0.02"; %IRSSI = ( authors => 'vague', contact => 'vague!#irssi@fgreenode', @@ -12,12 +12,13 @@ $VERSION = "0.01"; description => "compress logfiles then they're rotated, modified from original logcompress.pl to use perl modules instead", license => "Public Domain", url => "http://irssi.org/", - changed => "2016-01-31T01:45+0100" + changed => "2017-01-07T12:00+0100" ); sub sig_rotate { my $input = $_[0]->{real_fname}; gzip $input => "$input.gz" or Irssi::print(MSGLEVEL_CLIENTERROR, "gzip failed: $GzipError\n"); + unlink $input if -e "$input.gz"; } Irssi::signal_add('log rotated', 'sig_rotate'); |
