On Monday 05 March 2007 12:08 am, Dennis Peterson wrote: > > I ran it twice and both times it downloaded a new .hdb and .ndb file at > > least the 'modified' times were within a couple of minutes of the current > > time. I've commented out the > > I just now realized you're moving the downloaded file to the ClamAV > working directory rather than copying it. By doing this you defeat one > of the truly great things about rsync - intelligent copies. For small > files this isn't a big deal but for for very large files rsync has to > download the entire thing even though it may have only changed in the > last few lines. I'll give you an example - stop me if you've heard this... > Dennis, being someone that is greatly lacking in the area of scripting, how should the script read to download just the changes?
# ========================================================= # Check for new DB files. If new, download, test & process # ========================================================= curl -R -s -z scam.ndb.gz -o $tmp_dir/scam.ndb.gz \ http://www.sanesecurity.com/clamav/scam.ndb.gz test -s $tmp_dir/scam.ndb.gz && \ gunzip -cdf $tmp_dir/scam.ndb.gz > $tmp_dir/scam.ndb && \ mv -f $tmp_dir/scam.ndb.gz . && \ clamscan --quiet -d $tmp_dir/scam.ndb && \ cp --reply=yes scam.ndb scam.ndb-bak && \ mv -f $tmp_dir/scam.ndb . curl -R -s -z phish.ndb.gz -o $tmp_dir/phish.ndb.gz \ http://www.sanesecurity.com/clamav/phish.ndb.gz test -s $tmp_dir/phish.ndb.gz && \ gunzip -cdf $tmp_dir/phish.ndb.gz > $tmp_dir/phish.ndb && \ mv -f $tmp_dir/phish.ndb.gz . && \ clamscan --quiet -d $tmp_dir/phish.ndb && \ cp --reply=yes phish.ndb phish.ndb-bak && \ mv -f $tmp_dir/phish.ndb . rsync -aq --files-from=/usr/local/bin/msrbl.list \ rsync://rsync.mirror.msrbl.com/msrbl/ /var/tmp/clamdb # curl -R -s -z MSRBL-SPAM.ndb -o $tmp_dir/MSRBL-SPAM.ndb \ # http://download.mirror.msrbl.com/MSRBL-SPAM.ndb test -s $tmp_dir/MSRBL-SPAM.ndb && \ clamscan --quiet -d $tmp_dir/MSRBL-SPAM.ndb && \ cp --reply=yes MSRBL-SPAM.ndb MSRBL-SPAM.ndb-bak && \ mv -f $tmp_dir/MSRBL-SPAM.ndb . # curl -R -s -z MSRBL-Images.hdb -o $tmp_dir/MSRBL-Images.hdb \ # http://download.mirror.msrbl.com/MSRBL-Images.hdb test -s $tmp_dir/MSRBL-Images.hdb && \ clamscan --quiet -d $tmp_dir/MSRBL-Images.hdb && \ cp --reply=yes MSRBL-Images.hdb MSRBL-Images.hdb-bak && \ mv -f $tmp_dir/MSRBL-Images.hdb . I've included the whole download portion of the script including Steves. Thanks for the assistance. -- Chris KeyID 0xE372A7DA98E6705C
pgpFLjicpzTbQ.pgp
Description: PGP signature
_______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
