I like this sort of idea. If you are shutting down the website, then a phased process is good. (1)Stop accepting new connections ("we are down for monthly maintenance at time X, expected time-up is time Y"). (2)For users logged in and doing things, try to find some "stopping point" so that their connection can be closed gracefully and their transactions wind up in a consistent state to the best of your program's knowledge. You will have to decide what to do if you can't get the users to log off themselves.

The DB maintenance program that is gonna run may change things to the extent that any pending changes that you might be aware of won't work right. Anyway get the DB to what you figure is a consistent state.

Rather than you shutting down at a specific time, you could have some I/F so that this maint program requests a shutdown, and when it is done, you reply back that you are shut down. When it is finished, it tells you that you can come back online. You want to come back up ASAP when it is finished. This I/F could be pretty simple with some file flags and perhaps some cell phone message if things stay down for too long.

Anyway the shutdown from your end may take a variable amount of time. And obviously what this other thing does takes a variable amount of time.


In reply to Re^2: automating a task by Marshall
in thread automating a task by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.