Backup and Restorals issues

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Backup and Restorals issues

Post by Steve Horn »

Recently I've had several lengthy power outages (this is Alabama Power after all), so much so that even my HB server UPS has been exhausted. As a result, the HB server went down, taking HB with it. Windows 7 is fairly resilient to unplanned power interruptions, Not so much my HB server application, Both times, the database has become corrupted ("the record is deleted" message or something). Further, in spite of my careful use of backups those backups have not successfully restored HBDATA. Dunno why. But I was able to restore using a fairly recent copy of the HB autobackup file, so no major damage. But if one of two things would happen, this could be avoided: 1) HB becomes more resilient to a power failure, or 2) there was a way that HB could shut itself down x minutes after sensing a power failure. That could be done either by monitoring the messages from the Elk M1 panel (which I haven't got functioning yet but the subject of another thread), or using an input port on an I/O card used for general I/O to the outside world. (A wallwart and maybe an optoisolator should do it.) What I don't know of is the best way, once that condition is sensed, to actually close the HB app. Don't need to shut down Windows; just HB. I found a few things on the 'net: 1)the TSKILL command line command. 2) Using the NIRCMD utility, 3)a VBscript to send keystrokes via SENDKEYS. My preference at this point is the VBSCRIPT approach, but before I go further on it I thought I'd see if anyone here had some ideas.
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Backup and Restorals issues

Post by Richard Naninck »

Corrupted HBData files can easily be restored to functional by opening the dbase in MSAccess and perform a restore and compress. I have had that happen so many times that I even automated this in the HB startup.bat file. Before starting HB, the dbase gets compressed (or vacuumed) whereafter HB starts. A winner every time :!:
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Backup and Restorals issues

Post by Steve Horn »

Thanks. Clearly, I haven't tried that, but will on one of the known corrupted files. I'm still going to pursue the HB shutdown procedure. I think avoiding a corruption is better than easily (or not) restoring a corrupted DB. That typed, your idea of cleaning up and compressing as a routing matter is a good one.
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Backup and Restorals issues

Post by Richard Naninck »

Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Backup and Restorals issues

Post by Steve Horn »

Thanks to Win7, I was able to try your MS Access Restore and Compress (aka Compact & Repair) suggestion. Works quickly and apparently successfully, as I'm back in business. Upon restarting HB I did notice a message (4 times) in the sys log "Unable to parse default time span value [##############]" . I have no idea what that means but HB seems to run ok.

I do have an issue with the HB internal configuration backup option, File/Backup Configuration/Backup Now. While the resulting zip file may be able to be used to restore HB from within HB (I've never tried that), its utterly worthless when HB won't start because the database has been somehow corrupted, which is always the case here. If you look in the zip file, thinking that you could just extract the HBDATA.MDB you'd be disappointed because its not there, at least that I could find (and contrary to the text in the little help message with the Backup Now option). To me, it would make sense if the zipped file contained the exact image of Config, so that you could recover what was needed, which in my experience has ALWAYS been HBDATA.MDB.
I am backing up Housebot/Config externally using FBACKUP, but am having issues with restoring from that backup... dunno why. But as long as I can repair HBDATA using MS Access i'm reasonably happy. Thanks.
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Backup and Restorals issues

Post by Richard Naninck »

My setup (Meedio / HouseBot) gets a full backup each and every day done by Acronis with a rotation of four days. So the fourth bakup deletes the first thus keeping the latest three backups each new day.

I have never worked with the internal backup so no help there.

As for the Timespan error; I see that too. Probably means that the timer value got lost in the process and is set to something that cannot be processed hence reset to zero. A few years ago this would lead to an almost hang where a reset timer with value zero and Repeating = Yes would suck cpu because the timer would respawn instantly over and over from zero seconds.
The way I fixed this bug is by setting all the timer values in the Statup Task. So if HB gets corrupt and a time span value error would appear it would be automatically reset to its correct value when HB starts because the Startup Task sets the value. See attached image for my Startup Task.
Attachments
Startup.png
Startup.png (73.94 KiB) Viewed 3479 times
Post Reply