-###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];
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) {