Barry Gill wrote:
On the subject of Cron,

When I was still running Fedora Core 3, I was running my freshclam's
using cron but found from time to time that when I came in to work in
the morning I would have 20 to 30 cron processes still holding on
chewing up resource but not finishing off anything.

This caused me immense problems and was trhe primary reason for moving
away from cron to freshclam in daemon mode.



This is still possible and with anything run from cron you should exercise care. The first part of my wrapper for clam is:

#!/bin/sh

if /usr/bin/pgrep -x freshclam >/dev/null 2>&1; then
  echo 'Killing an instance of freshclam that is already running!' |\
    /usr/bin/mailx -s '[omak] freshclam error' [EMAIL PROTECTED]
  /usr/bin/pkill freshclam || echo 'Cannot kill freshclam instance'
fi

if [ -z "$1" ]; then
 /usr/bin/bash -c '/usr/bin/sleep $[ RANDOM % 900 ]'
fi

...

I get mail from mine about 3 times a week either because a previous version is running or because of communication errors with the mirror. The rule of thumb is don't start a new freshclam process until the old process has finished or is killed. I kill it because it should certainly not still be running at the next invocation, and if it is it cannot be doing anything useful.

dp

_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html

Reply via email to