]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - oldlogs.1.pl
Adapted for new config tool.
[ott/bsta] / oldlogs.1.pl
index 67fca652033fbc88d8c466726fe145de8554457a..d7151b71cacc98fbf78eba2b1061bc9a6bb169ff 100644 (file)
@@ -1,32 +1,32 @@
-###PERL;
+###RUN_PERL: #!/usr/bin/perl
 
 # oldlogs is generated from oldlogs.1.pl.
-# 02.01.2016
 #
 # This script renames log files if they are big enough.
 # Compresses or removes older log files.
 #
-#    Copyright (C) 2015-2016  Balthasar Szczepański
+# Copyright (C) 2015, 2016, 2023  Balthasar Szczepański
 #
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
 #
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-###GZIP_PATH;
-###LOG_PATH;
-###LOG_SIZE_LIMIT;
-###LOGS_TOTAL;
-###LOGS_UNCOMPRESSED;
+###PERL_GZIP:              GZIP              = gzip
+###PERL_LOG_PATH:          LOG_PATH          = /botm/log/bsta/
+###PERL_LOG_SIZE_LIMIT:    LOG_SIZE_LIMIT    = 65536
+###PERL_LOGS_UNCOMPRESSED: LOGS_UNCOMPRESSED = 2
+###PERL_LOGS_TOTAL:        LOGS_TOTAL        = 10
+
 
 if ($ARGV[0] ne '') {
        $log_path = $ARGV[0];
@@ -79,7 +79,7 @@ sub movelog {
        my $thispath;
        my $nextpath;
        my $nextnumber=$number+1;
-       my @gzip_arg = (GZIP_PATH, '-q', '-9','-f');
+       my @gzip_arg = (GZIP, '-q', '-9','-f');
        
        $thispath = $path.(($number != 0)?'.'.$number.($gz?'.gz':''):'');
        if ($number == $logs_total) {