Automate Database Backup and Shutdown Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Paul_B
    Automated Home Legend
    • Jul 2006
    • 608

    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
  • Gumby
    Moderator
    • May 2004
    • 437

    #2
    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

    Comment

    • Viv
      Automated Home Ninja
      • Dec 2004
      • 284

      #3
      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

      Comment

      • Paul_B
        Automated Home Legend
        • Jul 2006
        • 608

        #4
        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

        Comment

        • marcuslee
          Automated Home Ninja
          • Dec 2009
          • 279

          #5
          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 (!!).

          Comment

          • neilhooper
            Automated Home Guru
            • Oct 2008
            • 124

            #6
            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

            Comment

            • Karam
              Automated Home Legend
              • Mar 2005
              • 863

              #7
              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.

              Comment

              • marcuslee
                Automated Home Ninja
                • Dec 2009
                • 279

                #8
                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):


                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)?

                Comment

                • chris_j_hunter
                  Automated Home Legend
                  • Dec 2007
                  • 1713

                  #9
                  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 ...
                  Our self-build - going further with HA...

                  Comment

                  • marcuslee
                    Automated Home Ninja
                    • Dec 2009
                    • 279

                    #10
                    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)??

                    Comment

                    • chris_j_hunter
                      Automated Home Legend
                      • Dec 2007
                      • 1713

                      #11
                      not that I know - it occurs while we're working with PlanView, not noticed it happen when we're leaving it alone (and if it did, we would have noticed the relaunches, if only in how back Message Service Reports go back) ...
                      Our self-build - going further with HA...

                      Comment

                      Working...
                      X