11/05/05 - It is important to note that Mary was moved again (sometime early in 2003) to yet another operating system:  Window 2000 Server.  This doesn't change much except now the computer Mary is in (Hobbes) is also a domain controller since I needed a second controller so my user database was backed up somewhere.

Everything below in blue was kept for historical purposes (that is the way it used to be).  This system is always in a state of change in order to continuously improve operations.  Mary was recently updated to NT4.0 which doesn't seem to respond properly to the below mentioned event.  The good side of this however is NT is much more stable and doesn't seem to have the problem with what apparently seems to be a memory leak.  Mary now runs for literally weeks at a time with only ECS having to restart from time to time due to the web server failing to respond; explained in Log Management

Configuration backups need to take place daily with history; explained in Config Backup.

As just about everybody knows that has a computer that runs any kind of Microsoft multitasking environment, the dang thing just likes to crash after running for an extended period of time.  I had my fill of coming home and expecting the lights to turn on and finding that Mary (or Hobbes) was locked up tighter than a drum with the only fix being to reboot, often times not gracefully.  

ECS purges logs at midnight and since we log all motion detector activity, this sometimes takes quite a while.  ECS also has the ability to emulate keystrokes on a keyboard.  Since gracefully booting the PC can be accomplished via the keyboard and the same purging takes place when ECS is started, why not reboot the PC just before  midnight and kill two birds with one stone?  Actually, I would prefer to boot the PC later but the log purging had a tendancy to cause some interference with the boot event.  This took a while to figure out but it appears to boot quite a bit more regularly since it was changed to boot at 23:58.

Here is the daily boot event:

If Time Is Now 11:58 PM

Then Reboot Set True

Then what happens?  There is an event that does nothing but watch the Reboot item:

BEGINIF Reboot Is True            ->Watch the item "Reboot" for true

Do Reboot Set False               ->Unconditionally change it back to false

If Operating-System Is Windows

Then Text, Reboot Set Log/Speak   ->Log and speak our reboot attempt.

Then KB:<CTL> Set Down            -><CTL>+<ESC> brings up the task bar and the start menu.

Then KB:<ESC> Set Down/Up

Then KB:<CTL> Set Up

Then KB:U Set Down/Up             ->Enter 'U' for shutdown

Then KB:R Set Down/Up             ->Enter 'R' for reboot

Then KB:Enter Set Down/Up         ->Enter <ENTER> to execute reboot sequence

Then KB:<CTL> Set Down            ->Start this whole thing again in case it failed for some reason the first time

Then KB:<ESC> Set Down/Up

Then KB:<CTL> Set Up

Then KB:U Set Down/Up

Then KB:R Set Down/Up

Then KB:Enter Set Down/Up

ENDIF

There are two attempts because quite often the first one failed.  The success rate of the reboot item went from around 20% to around 95% when the second attempt was added.  It does seem if the PC is left alone with no changes made to ECS, it is also much more successful.

In order to make sure the PC is booting regularly, we run a batch file when Windows (98) comes up with the Task Scheduler that enters the time and date into a log file.  The batch file looks like this:

@echo off
echo Windows 98 Starting... >> c:\winstart.txt
type c:\batch\nullfile.txt | date | find "Current" >> c:\winstart.txt
type c:\batch\nullfile.txt | time | find "Current" >> c:\winstart.txt

The nullfile.txt is exactly that; a file that has nothing but a null character (oxymoron?) in it.  This answers the date and time questions asked by DOS when these programs are invoked.