Hi Jim,

not terribly complicated. Chances are, you have most of it in place.  Here
I'll dissect the script  that I use.  It incorporates conditional and
compressed downloads, detection of corrupted/incomplete rule-base downloads,
regular uploading of log files to Sniffer server and weekly deleting of log
files.


A) if you're using CURL to download, make sure you use the -R -z -H options.
Here the sample (must be all in one line):

curl http://www.sortmonster.net/Sniffer/Updates/[MyLicenseCode].snf 
   -o [MyLicenseCode].snf.gz 
   -s -S 
   -R -z [MyLicenseCode].snf 
   -H "Accept-Encoding:gzip" 
   -u sniffer:ki11sp8m

B) if you're using WGET to download, make sure you use the -N and -header
options.  Here the sample (must be all in one line):

wget -N http://www.sortmonster.net/Sniffer/Updates/[MyLicenseCode].snf 
   -O [MyLicenseCode].snf.gz 
   -q
   --header=Accept-Encoding:gzip 
   --http-user=sniffer --http-passwd=ki11sp8m 


C) Use conditional statements to see if any new updates were downloaded,
then use GZIP to uncompress the file and then validate the file:

if exist [MyLicenseCode].snf.gz goto :Check
goto :EOF
:Check
REM Unpack and validate new Sniffer rulebase
move /Y "C:\[MySnifferFolder]\Win32\[MyLicenseCode].snf.gz"
"C:\[MySnifferFolder]"
gzip.exe -d -f -N C:\[MySnifferFolder]\[MyLicenseCode].snf.gz"
snf2check.exe C:\[MySnifferFolder]\[MyLicenseCode].snf [MyLicensePassword]
if errorlevel 1 goto :EOF

This will move the .gz file to a temporary folder, uncompress and validate
the .snf rule base.
If no file was downloaded or if it is not a valid rule base, it will abort
the script.


D) I like to keep a backup of my rule base, and then I replace and activate
the new rule base:

if exist [MyLicenseCode].snf.bak erase [MyLicenseCode].snf.bak
rename [MyLicenseCode].snf [MyLicenseCode].snf.bak
move /Y "C:\[MySnifferFolder]\[MyLicenseCode].snf"
"C:\[MySnifferFolder]\Win32"
[MyLicenseCode].exe reload


E) Finally - I upload my logs to the good Sniffer folks, as requested and
delete old log files after a week.

ftp -n -s:C:\[MySnifferFolder]\SnifferUpload.txt ftp.sortmonster.net
[MyLicenseCode].exe rotate
forfiles -m*.log.* -d-7 -v -c"cmd /c erase @FILE"


F) Add this script to a program alias, e.g.:

        C:\[MySnifferFolder]\SnifferUpdate.cmd
>>C:\[MySnifferFolder]\SnifferUpdate.log

and register that alias with Sniffer for automatic updates.  If you don't
want to trust/rely on just one mechanism, also schedule 

  "C:\[MySnifferFolder]\SnifferUpdate.cmd
>>C:\[MySnifferFolder]\SnifferUpdate.log"

every two hours based on the staggered times listed here:

  http://www.sortmonster.com/MessageSniffer/Help/LogsHelp.html#When

Other than a quick HTTP "header" check to see if a new file exists every two
hours, you would not cause any loss of bandwidth for the Sniffer folks.  If
your bi-hourly update DOES download something, then their nofitications
either didn't reach you or were late.


Best Regards
Andy Schmidt

H&M Systems Software, Inc.
600 East Crescent Avenue, Suite 203
Upper Saddle River, NJ 07458-1846

Phone:  +1 201 934-3414 x20 (Business)
Fax:    +1 201 934-9206

http://www.HM-Software.com/ 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jim Matuska
Sent: Monday, December 27, 2004 01:51 PM
To: sniffer@SortMonster.com
Subject: Re: Re[2]: [sniffer] Sniffer Updates


Does anyone have any good instructions on how to modify your update scripts
to use gzip?  

Jim Matuska Jr.
Computer Tech2, CCNA
Nez Perce Tribe
Information Systems
[EMAIL PROTECTED]


This E-Mail came from the Message Sniffer mailing list. For information and 
(un)subscription instructions go to 
http://www.sortmonster.com/MessageSniffer/Help/Help.html

Reply via email to