1 >> checks for a new file from CURL. It also uses the -v (verbose) option
with CURL and captures it's output to the getRulebase.txt file for
reporting. If there is an error then the details will be seen. <<

 

I'm glad to see that (after a few tries), your script finally looks like the
one I had sent last September <G>

 

The benefit for checking the CURL errorlevel:

 

if %ERRORLEVEL% NEQ 0 goto CLEANUP

 

is that it gracefully handles incomplete .NEW files that might result from
interrupted file transfers. There's no reason for snf2check to "Hick Up" and
report on a SNF file, if the download was never successful!

 

2. Agreed on complexity. Just to keep things in perspective - the added two
lines below shoe how "complex" the support for dedicated rulebase and work
subfolders really is <G>: Nothing changes for clients who don't use
subfolders - nothing changes in the installer!

 

REM ----- Edit This Section --------

SET SNIFFER_PATH=C:\SNF

SET RULEBASE_PATH=%SNIFFER_PATH%

SET WORKSPACE_PATH=%SNIFFER_PATH%

 

But clients who do choose to set up subfolders, would at least be able to
use your standard script:

 

REM ----- Edited to Support Dedicated Subfolders --------

SET SNIFFER_PATH=D:\IMail\declude\SNF

SET RULEBASE_PATH=%SNIFFER_PATH%\Rulebase

SET WORKSPACE_PATH=%SNIFFER_PATH%\Workspace

 

I'm a big believer in keep dynamic data separate from static program/config
files. Prevents things from being overlooked, things from accidentally being
"cleaned up" that shouldn't be, allows proper execute/change permissions
being set - and by avoiding mistakes ultimately improves stability.

 

I'm not complaining. Last year I had pointed out that CURL should be used to
maintain file dates and had submitted the simple change to the script
(including checking the return code AND checking for the existence of a
downloaded file AND cleaning up the Log File.!) - which were finally
incorporated. So there's hope that some future event will eventually make
the benefits of dedicated "data" subfolders equally apparent <G>.

 

Best Regards,

Andy

 

From: Message Sniffer Community [mailto:snif...@sortmonster.com] On Behalf
Of Pete McNeil
Sent: Tuesday, March 10, 2009 10:20 AM
To: Message Sniffer Community
Subject: [sniffer] Re: DST update problem - server changes

 

Andy Schmidt wrote: 

Hi,

 

That's why the enhanced version of your script (which properly supports
Sniffer's ability to keep the rulebase and the workspace in subfolders!)
that I sent you checks for CURL success AND for an existing file.

 

curl http://www.sortmonster.net/Sniffer/Updates/%LICENSE_ID%.snf
<http://www.sortmonster.net/Sniffer/Updates/%25LICENSE_ID%25.snf>  -s -R -f
-o %RULEBASE_PATH%\%LICENSE_ID%.new -z %RULEBASE_PATH%\%LICENSE_ID%.snf
--compressed -u sniffer:ki11sp8m -D %SNIFFER_PATH%\curlhdr.txt

if %ERRORLEVEL% NEQ 0 goto CLEANUP

if not exist %RULEBASE_PATH%\%LICENSE_ID%.new goto CLEANUP

The newest version (just posted before I received this note) checks for a
new file from CURL. It also uses the -v (verbose) option with CURL and
captures it's output to the getRulebase.txt file for reporting. If there is
an error then the details will be seen.

curl -v  <http://www.sortmonster.net/Sniffer/Updates/%25LICENSE_ID%25.snf>
"http://www.sortmonster.net/Sniffer/Updates/%LICENSE_ID%.snf"; -o
%LICENSE_ID%.new -s -S -R -z %LICENSE_ID%.snf -H "Accept-Encoding:gzip"
--compressed -u sniffer:ki11sp8m 2>> getRulebase.txt

if not exist %LICENSE_ID%.new echo New rulebase file NOT downloaded >>
getRulebase.txt
if not exist %LICENSE_ID%.new goto CLEANUP




 

snf2check.exe %RULEBASE_PATH%\%LICENSE_ID%.new %AUTHENTICATION%

 

>> goto DONE<<

 

I recommend you go to "Cleanup" - where the .LCK file will be cleaned up if
it exists.


The new script does this and it also reports success explicitly

snf2check.exe %LICENSE_ID%.new %AUTHENTICATION% 2>> getRulebase.txt

if errorlevel 1 goto CLEANUP

echo New rulebase file tested OK >> getRulebase.txt

The script we are using does not yet support alternate/sub folders because
we have not built that capability into our windows installer. Using
alternate/sub folders is a custom modification and is likely to be different
on each system so we aren't (yet) making any attempt to have our installer
predict or understand this kind of configuration. 

A later version of the script might include some hooks to do that but they
will need to be ignored by the installer for the time being.

Trying to keep things simple.

Thanks,

_M



Reply via email to