Cortex PC power down options

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • marcuslee
    Automated Home Ninja
    • Dec 2009
    • 279

    Cortex PC power down options

    Hi Guys,

    In leiu of testing myself, what option to people use for their Cortex PC when the UPS is about to die - do they use the shutdown, hibernate, or sleep option?

    Thinking in terms of cleanest shutdown for Cortex (and subsequent power back) when power is restored.

    Cheers,

    Marcus
  • achapman
    Automated Home Jr Member
    • Jan 2006
    • 43

    #2
    I would always do a full shutdown if possible. There is always the possibility of a corruption with hibernation if something goes wrong during the process. A full shutdown will leave the system in the cleanest state.

    The only reason to choose one of the other options would be to reduce boot time, which I wouldn't have thought was a major consideration and not worth the risks it introduces into the process.

    You need to shutdown and restart anyway to process windows updates, so if there are any pending this also makes sure they are processed.

    Comment

    • marcuslee
      Automated Home Ninja
      • Dec 2009
      • 279

      #3
      Originally posted by achapman View Post
      I would always do a full shutdown if possible. There is always the possibility of a corruption with hibernation if something goes wrong during the process. A full shutdown will leave the system in the cleanest state.

      The only reason to choose one of the other options would be to reduce boot time, which I wouldn't have thought was a major consideration and not worth the risks it introduces into the process.

      You need to shutdown and restart anyway to process windows updates, so if there are any pending this also makes sure they are processed.
      Thanks for reply, and completely agree with your points, however I was more looking towards Cortex as the application, things like, does it actually gracefully shutdown when WinXP gives it the 'i'm shutting down' message?

      Does it shutdown in time, etc?

      Comment

      • chris_j_hunter
        Automated Home Legend
        • Dec 2007
        • 1713

        #4
        presumably the time required will be a function of the speed of the PC and the number of modules / network objects ...

        ie: how long it takes to stop the network, download node / module data, and then save database & history & log files ...

        if desperate, and still building the network, the database save might have priority & be enough - ours takes maybe thirty seconds to do one ... if network is mature, maybe download & history update would have priority - ours would need maybe a couple of minutes ... and if there are problems needing to be solved, maybe the log file ...

        we find stopping & saving faster than start-up (which can take five minutes, perhaps more) ...

        so perhaps the answer is that the UPS should give ten, maybe five, or at least three minutes warning ! (?)
        Last edited by chris_j_hunter; 13 April 2012, 04:11 PM. Reason: typo's
        Our self-build - going further with HA...

        Comment

        • marcuslee
          Automated Home Ninja
          • Dec 2009
          • 279

          #5
          Originally posted by chris_j_hunter View Post
          presumably the time required will be a function of the speed of the PC and the number of modules / network objects ...

          ie: how long it tales to stop the network, download node / module data, and then save database & history & log files ...

          if desperate, and still building the network, the database save might have priority - ours takes maybe thirty seconds to do one ... if network is mature, maybe download & history update would have priority - ours would need maybe a couple of minutes ... and if there are problems needing to be solved, maybe the log file ...

          we find stopping & saving faster than start-up (which can take five minutes, perhaps more) ...

          so perhaps the answer is that the UPS should give ten, maybe five, or at least three minutes warning ! (?)
          So the only missing piece of the puzzle is:
          - how do you execute a shutdown of Cortex from the command line?

          As per attached WinXP has the ability to run a program on the alarm (at the Critical battery level / "the system is about to call it a day"), but what do we do to let Cortex know to pack it in before shutdown?
          Attached Files

          Comment

          • chris_j_hunter
            Automated Home Legend
            • Dec 2007
            • 1713

            #6
            yep, and also how do we get our UPS to provide the signal ...

            it's an fairly ancient MGE / Pulsar EXtreme 3200C - with a USB connection that's yet to be explored & some so-called programmable outputs that can be arranged to shed load at defined points - and so might provide a way (via a relay) ...
            Last edited by chris_j_hunter; 14 April 2012, 10:57 AM.
            Our self-build - going further with HA...

            Comment

            • Viv
              Automated Home Ninja
              • Dec 2004
              • 284

              #7
              Their currently is no mechanism to inform Cortex to shutdown the network and then save the database without user intervention. It may be possible but I would actually question the benefits.

              You have to consider you are asking it to perform a processes during which there is a much higher probability of the PC losing power. I'm not sure how reliable battery calculations for remaining time are on a ups.

              When Cortex is running its main disk access process is for the History files.
              Each day is recorded in a separate file so that should a problem arise with that days history file, most history is retained. Further the method of writing the history data and the file structure should mean history is recorded up to the last instance before power loss and the file remain wholesome (although obviously not guaranteed).

              Similarly Camera recordings are made as fragments in separate files so on power loss most recordings should be retained.

              So currently if you get a power loss to the PC the only loss of data should be any changes made to the database since the last save.

              If the UPS instigated a Cortex shutdown and Cortex was saving the database as the power was lost the database could theoretically be corrupted. Having said that the database is actually save under a different name and only on completion is it renamed to the correct name thereby minimizing the time window of possible corruption. If the databae file was in error a backup version is available called FileName.~cd

              Viv

              Comment

              • marcuslee
                Automated Home Ninja
                • Dec 2009
                • 279

                #8
                Originally posted by Viv View Post
                Their currently is no mechanism to inform Cortex to shutdown the network and then save the database without user intervention. It may be possible but I would actually question the benefits.

                You have to consider you are asking it to perform a processes during which there is a much higher probability of the PC losing power. I'm not sure how reliable battery calculations for remaining time are on a ups.

                When Cortex is running its main disk access process is for the History files.
                Each day is recorded in a separate file so that should a problem arise with that days history file, most history is retained. Further the method of writing the history data and the file structure should mean history is recorded up to the last instance before power loss and the file remain wholesome (although obviously not guaranteed).

                Similarly Camera recordings are made as fragments in separate files so on power loss most recordings should be retained.

                So currently if you get a power loss to the PC the only loss of data should be any changes made to the database since the last save.

                If the UPS instigated a Cortex shutdown and Cortex was saving the database as the power was lost the database could theoretically be corrupted. Having said that the database is actually save under a different name and only on completion is it renamed to the correct name thereby minimizing the time window of possible corruption. If the databae file was in error a backup version is available called FileName.~cd

                Viv
                Ok thanks for reply Viv.

                So in other words there is no way to automate / CLI execute a "Stop Network and shutdown Cortex" command.

                I think though it'd be a nice to have, as with regards to accuracy of UPS provisioned alarm in WinXP, in answer it can be very good. In fact good enough for Corporates and Enterprise to use it.

                Also FYI the thinking behind the use of it the commercial space is, to be honest, if you've hit the stage the Data Centre has got to the point where it's all going Titanic, then preferentially we'd like to do a controlled shutdown of our OS and supporting apps then to let it go under with just a hard power down / something is better than nothing, but to be honest, we're actually acutely aware that we're in whole lotta poo anyway (!!).

                Comment

                • Viv
                  Automated Home Ninja
                  • Dec 2004
                  • 284

                  #9
                  An update for Marcus.

                  In the next version (26) of Cortex, the API will accept a command to 'Anaesthetise'.
                  This will shut the network down, save database and then close Cortex.

                  We will supply a program that can be executed (Anaesthetise.exe) that then communicates with the Cortex API and causes the shutdown.

                  Viv

                  Comment

                  • marcuslee
                    Automated Home Ninja
                    • Dec 2009
                    • 279

                    #10
                    Originally posted by Viv View Post
                    An update for Marcus.

                    In the next version (26) of Cortex, the API will accept a command to 'Anaesthetise'.
                    This will shut the network down, save database and then close Cortex.

                    We will supply a program that can be executed (Anaesthetise.exe) that then communicates with the Cortex API and causes the shutdown.

                    Viv
                    Wow, fab for taking this into the the Suggestion Box and executing so quickly on this!

                    Cheers Viv.

                    Comment

                    Working...
                    X