Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Automate Database Backup and Shutdown Script

  1. #1
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    580

    Question Automate Database Backup and Shutdown Script

    Happy New Year all!

    Does anyone know if it is possible to automate the task of periodically taking a backup copy of the database? I thought I might be able to use an event to does this but it doesn't appear this is supported. I run Cloudberry backup on my clients but as the database file for*Cortex is locked open or at least you don't want to try and access this file at the same time as Cortex I wanted to take a backup to a separate folder and have the backup software then backup the database copy.

    In a similar way I would like to be able to gracefully shutdown the Idratek network so that my machine can be periodically rebooted, for example during monthly patching. Windows has the capability of running shutdown scripts prior to going down. Again is it possible to interact with Cortex such that on a script could call the network to stop, if necessary the database backed up and Cortex exited before shutting down?

    Many thanks

    Paul

  2. #2
    Moderator Gumby's Avatar
    Join Date
    May 2004
    Location
    Gloucestershire
    Posts
    427

    Default

    Slightly different approach - I use TortoiseHg to version control the database file. You can then push the changes to a repository clone somewhere else. Hg has command line so could be scripted. Personally I commit the changes with a comment when I make them so I can remember what I have changed.
    ----------------------
    www.gumbrell.com

  3. #3
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    It a long time since tested or tried but you should find an application in the Cortex Directory call Anaesthetise.exe.
    This communicates with Cortex via the Cortex WinAPI so should be turned on.

    The idea was a UPS could run this applcation which will shutdown Cortex in an orderly manner when the UPS was running out of power.

    Viv

  4. #4
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    580

    Default

    Nice! I might have two use cases that could use anaesthetise.exe one for backup and the other for a detecting when the power is lost and the PC running Cortex is running on battery

    Thanks

    Paul

  5. #5
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    258

    Default

    Quote Originally Posted by Paul_B View Post
    Nice! I might have two use cases that could use anaesthetise.exe one for backup and the other for a detecting when the power is lost and the PC running Cortex is running on battery
    l
    Indeed nice. Paul would be great to hear how you get on with this?

    For myself, on the probably only single occasion where there's been mains loss and battery runs down to depletion, I've just had Cortex close ungracefully when Windows begins it's shutdown sequence (!!).

  6. #6
    Automated Home Guru neilhooper's Avatar
    Join Date
    Oct 2008
    Location
    Hereford, United Kingdom
    Posts
    123

    Default

    Paul,

    I use the Scheduler to Save the Database every two hours as I found that the History is not kept unless you do a periodic Save. When you Save, a Backup copy of the Database appears in your \Idratek\Cortex\Database\ folder. I use Acronis True Image to do a daily backup of Idratek folder and a weekly backup of complete PC to my NAS.

    I've only ever needed to recover the Database once from the backup and was able to do so without issue.

    - Neil

  7. #7
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    766

    Default

    Neil,

    When you use the term 'history' I presume that you mean history of database changes? E.g. what might be held in memory for 'undo' operations. Just the term 'history' is also often used by us to refer to the continuously captured system data - as in what goes into the History folder.

  8. #8
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    258

    Default

    Quote Originally Posted by Paul_B View Post
    Nice! I might have two use cases that could use anaesthetise.exe one for backup and the other for a detecting when the power is lost and the PC running Cortex is running on battery

    Thanks

    Paul
    Having looked into this (as I'm looking for same scenario as the second, where the Cortex PC is running out of battery, and Windows hits that point (Critical) it decides to shutdown), I don't think there is a mechanism to use anethesis.exe (Windows already sends the kill command to all Apps, before then running any Shutdown scripts):
    https://www.experts-exchange.com/que...-shutdown.html

    I've not actually sat and tracked myself, but anyone ever seen what happens to Cortex when the kill command is sent by Windows (is Cortex shutdown graceful or is it dead stop/ungraceful)?

  9. #9
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,622

    Default

    we're running Win8.1, and find it now & then thinks Cortex is not responding (9 times out of 10 erroneously) - it presents a dialogue box and, when click the option, Cortex just gets zapped ... b.annoying ! If click the X, then it's not so hasty ...

  10. #10
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    258

    Default

    Quote Originally Posted by chris_j_hunter View Post
    we're running Win8.1, and find it now & then thinks Cortex is not responding (9 times out of 10 erroneously) - it presents a dialogue box and, when click the option, Cortex just gets zapped ... b.annoying ! If click the X, then it's not so hasty ...
    Is that... a corrupt install (I only run Win7, but presume that it would have been mentioned before now on the forum for Win8/8.1 people)??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •