The main reason Mary was moved on to an NT PC is NT supports rsh and rcp to a UNIX computer.*  This makes purging the event log much easier and quicker.  This log was taking at least 30 minutes (sometimes up to an hour) to purge.  Now that purging job only takes a matter of seconds (literally).  With the use of a batch file, we can even purge during the day when we have to restart ECS. 

This is kind of tricky so if you plan to implement something like this, pay close attention...

There are two batch files to start ECS.  This is so we can pass variables.  We also wanted to re-use some code so originally we intended to break this up but this is as far as we got.  The first batch file has a link from the startup folder to start ECS when the PC restarts:  STARTECS.BAT  This batch file runs the second:  ECS.BAT  The second file copies msg.log to cliff (FreeBSD or UNIX'ish PC) via rcp, remotely runs a shell script to shrink the number of entries down to 5000 (actually 4080 in case there are a couple of startup logs so none are lost) via rcp, and copies the new msg.log back to Mary.  This takes approximately 5 seconds.

The next piece of this puzzle is the shell script on cliff:  ECS.MSG.MGR  This script has a couple of dependencies including awk which may or may not work depending upon the flavor and version you have on your machine.  The other two dependencies are a hex to decimal converter and a decimal to hex converter.  If you need help writing these scripts, send me an email.  Each of these scripts have their own dependencies so the file list starts to get out of hand if I try and get everything included here.

The message manager performs a couple of steps that may be of some interest.  First thing is to get everything over 5000 logs out so we have a file to be copied back.  Second is to find out how many logs are to be purged so we can skim them off and keep them in a local file (we keep them for 30 days).  Last, we delete any files that may be left from 30 days ago.

 

*  11/05/05 - PuTTY later fixes this problem with SSH.