I've got a perl script running (amavisd) which I'm trying to rotate
the log file, problem is, it quits perl and leaves the process not
running.
Here's the code.
#!/bin/sh -
#
echo -n "Rotating log files:"
cd /var/log/clamav
for i in clamd.log freshclam.log amavis.log; do
if [ -f "${i}" ]; then
echo -n " ${i}"
if [ -f "${i}" ]; then mv -f "${i}" "${i}.0" && if [ -x
/usr/bin/gzip ]; then gzip -9 "${i}.0"; fi; fi
touch "${i}" && chmod 644 "${i}" && chown clamav:admin "${i}"
fi
done
if [ -f /var/amavis/amavisd.pid ]; then kill -HUP $(cat
/var/amavis/amavisd.pid | head -1); fi;
if [ -f /var/clamav/clamd.pid ]; then kill -HUP $(cat
/var/clamav/clamd.pid | head -1); fi
if [ -f /var/clamav/freshclam.pid ]; then kill -HUP $(cat
/var/clamav/freshclam.pid | head -1); fi
clamd and freshclam seem to resync the log files but amavisd doesn't.
Anyone have a solution?