On Tue, Jan 08, 2008 at 10:47:28PM +0000, Bob Hutchinson wrote:
> On Tuesday 08 January 2008 18:05, Charles Mckee wrote:
[how to update on multiple clients]
> > Cool thank you !! I must install a webserver !!
> 
> or use rsync

And don't forget to "clamdctl reload". Err... that is
kill -USR2 `cat /path/to/clamd.pid`, if the databases changed.

We use a script that's similar to what's below. This script is run
from cron, and via ssh to all clients, when the master's OnUpdateExecute
is triggered.

    #!/bin/sh

    # change these if necessary for your system
    MD5=`which md5`                     # ... or use md5sum.
    CLAMDB=/usr/local/clamav
    CLAMD_PID=/var/run/clamav/clamd.pid
    MASTER=machine.example.com:/path/to/master/clamav/database

    CLAMFILES=`find $CLAMDB -type f`
    if [ -n "$CLAMFILES" ]; then
        CLAMSTATE=`cat $CLAMFILES | $MD5`
    else
        CLAMSTATE=empty
    fi

    rsync -crlpgo --delete $MASTER $CLAMDB

    CLAMFILES=`find $CLAMDB -type f`
    CLAMNEW=`cat $CLAMFILES | $MD5`
    if [ "$CLAMSTATE" != "$CLAMNEW" ]
    then
        ### Reload clam databases
        kill -USR2 `cat $CLAMD_PID`
    fi

Note that we left "ScriptedUpdates yes" on the master freshclam. The
only downside is that it occasionally triggers an update while freshclam
is unpacking a new database in a temporary directory, which causes
a bunch of warnings for missing files during transfer. These are harmless.
(At least, I assumed they are harmless. I should fix the exclude file
on rsync one of these days to skip those tempfiles :)

-- 
Jan-Pieter Cornet <[EMAIL PROTECTED]>
!! Disclamer: The addressee of this email is not the intended recipient. !!
!! This is only a test of the echelon and data retention systems. Please !!
!! archive this message indefinitely to allow verification of the logs.  !!
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html

Reply via email to