summaryrefslogtreecommitdiff
path: root/CommModule
diff options
context:
space:
mode:
authorBernhard Fröhlich <bernhard@cacert.org>2018-10-29 20:07:10 +0100
committerBernhard Fröhlich <bernhard@cacert.org>2019-02-13 20:09:33 +0100
commitc4243c9e925529eb0f01d81f026e57b4c3767176 (patch)
tree4a762288821921c294173b3df805b2e84cfcd07a /CommModule
parent4669a0cf4c03c5ed4910439b2f08f42171f4b677 (diff)
downloadcacert-devel-c4243c9e925529eb0f01d81f026e57b4c3767176.tar.gz
cacert-devel-c4243c9e925529eb0f01d81f026e57b4c3767176.tar.xz
cacert-devel-c4243c9e925529eb0f01d81f026e57b4c3767176.zip
source code taken from cacert-20180906.tar.bz2
Diffstat (limited to 'CommModule')
-rwxr-xr-xCommModule/logclean.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/CommModule/logclean.sh b/CommModule/logclean.sh
index 99963ee..62aa04c 100755
--- a/CommModule/logclean.sh
+++ b/CommModule/logclean.sh
@@ -2,6 +2,9 @@
# logclean.sh - maintenance script for logfiles generated by CommModule
# run this daily or weekly from cron
+COMPRESS="xz -9 -M 1GiB" # compression program to use
+COMPRESS_EXT=xz # file extension for compression program
+
syslog_error()
{
logger -i -t CommModule/logclean.sh -p user.err $1
@@ -31,12 +34,12 @@ if [ -n "${FILES}" ]
then
for F in ${FILES}
do
- syslog_notice "Compressing ${F}" && bzip2 ${F}
+ syslog_notice "Compressing ${F}" && ${COMPRESS} ${F}
done
fi
# move compressed logfiles to oldlogs directory
-FILES=`find logfile20*.txt.bz2 -print`
+FILES=`find logfile20*.txt.${COMPRESS_EXT} -print`
if [ -n "${FILES}" ]
then
mkdir -p oldlogs
@@ -47,7 +50,7 @@ then
fi
# delete old logfiles which have not been modified in at least 2.5+ years
-FILES=`find oldlogs/logfile20*.txt.bz2 -mtime +913 -print`
+FILES=`find oldlogs/logfile20*.txt.${COMPRESS_EXT} -mtime +913 -print`
if [ -n "${FILES}" ]
then
for F in ${FILES}