File suse.de-nagios of Package nagios32
x
1
#!/bin/sh
2
#
3
# Compress old nagios logfiles in /var/log/nagios/archives/
4
# once a week, if sysconfig variable is set to true
5
#
6
if [ -r /etc/sysconfig/nagios ]; then
7
. /etc/sysconfig/nagios
8
else
9
echo "/etc/sysconfig/nagios not found or not readable."
10
exit 1
11
fi
12
13
if [ x"$NAGIOS_COMPRESS_LOGFILES" = x"true" ]; then
14
LOGS=$(echo /var/log/nagios/archives/*.log)
15
for f in $LOGS ; do
16
if [ -e $f ] ; then
17
/usr/bin/bzip2 /var/log/nagios/archives/*.log
18
break
19
fi
20
done
21
fi
22