Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: smart automatic updates 1


From   Lars Korsholm <[email protected]>
To   [email protected]
Subject   st: smart automatic updates 1
Date   Thu, 26 Feb 2004 16:55:14 +0100 (MET)

Hi Listers

Quetion 

I would like to write a small program to be run each midnight or weekly 
on a network-server with stata.
I would like the program to update stata
if the update is timed out etc, I would like it to retry a specified
number of times, and when the update is succesful run -update swap-
and when the update quntinuous to fail I would like an error in a log or
somthing.

Look this would be very smart! :-)

However I cant fiugre out how to get hold on the right locals at the right
steps in the procedure. Can anyone of the more skilled members tell me?

A first draft of smart_update.do could be

        /* Check for updates */
        qui update query
        local adoinst = r(inst_ado)
        local adoavbl = r(avbl_ado)
        local exeinst = r(inst_exe)
        local exeavbl = r(avbl_exe)

        
        if `adoinst' != `adoavbl'  |  `exeinst'!=`exeavbl' {
          while ..... {
              update all
             ....
             }
          if `exeinst'!=`exeavbl' & [update were succesful] { 
                    update swap
                    }
          if [update were NOT succesful] { 
                     di "unsuccesfull update"
                     }
           }
         else {
           di "no updates needed"
           }


Kind regard
        

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index