File suse.de-nagios of Package nagios.import4839

#!/bin/sh
#
# Compress old nagios logfiles in /var/log/nagios/archives/
# once a week, if sysconfig variable is set to true
#
if [ -r /etc/sysconfig/nagios ]; then 
. /etc/sysconfig/nagios
else
	echo "/etc/sysconfig/nagios not found or not readable."
	exit 1
fi

if [ x"$NAGIOS_COMPRESS_LOGFILES" = x"true" ]; then
	LOGS=$(echo /var/log/nagios/archives/*.log)
	for f in $LOGS ; do
		if [ -e $f ] ; then
			/usr/bin/bzip2 /var/log/nagios/archives/*.log 
			break
		fi
	done
fi
openSUSE Build Service is sponsored by