Results 1 to 10 of 10

Thread: Cortex PC power down options

  1. #1
    Automated Home Guru marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    219

    Default 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

  2. #2
    Automated Home Jr Member
    Join Date
    Jan 2006
    Location
    Oxford, England
    Posts
    32

    Default

    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.

  3. #3
    Automated Home Guru marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    219

    Default

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

  4. #4
    Automated Home Legend
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,370

    Default

    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; 13th April 2012 at 05:11 PM. Reason: typo's

  5. #5
    Automated Home Guru marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    219

    Default

    Quote 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 Images Attached Images

  6. #6
    Automated Home Legend
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,370

    Default

    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; 14th April 2012 at 11:57 AM.

  7. #7
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    253

    Default

    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

  8. #8
    Automated Home Guru marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    219

    Default

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

  9. #9
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    253

    Default

    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

  10. #10
    Automated Home Guru marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    219

    Default

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

Posting Permissions

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