Re: [SLE] Pullin' my hair out... arrrgh

From: Carlos E. R. (robin1.listas_at_tiscali.es)
Date: 08/05/04

  • Next message: Carlos E. R.: "Re: [SLE] reply-to settings"
    Date: Thu, 5 Aug 2004 12:34:16 +0200 (CEST)
    To: SLE <suse-linux-e@suse.com>
    
    

    The Wednesday 2004-08-04 at 20:29 -0500, C Hamel wrote:

    > On Wednesday 04 August 2004 14:00, Misty Stanley-Jones wrote:
    > > Every 18 hours huh? 18 is a multiple of 6. 6*3 is 18, 6*4 is 24. Every
    > > 18 hours would be 6, 24, 18, 12. Run the cron job at all of these times,
    > > have it check for a file /tmp/should_run that gets generated when the
    > > script should run.
    > >
    > Not sure that I follow you. Would you mind elaborating? (Have you heard the
    > story of the donkey that needed a 2x4 in the head to get its attention so it
    > would plow?)

    Simple enough. Suppose you start at 00 hours. The next time, 18 hours
    later, would be at 18:00. The next time at 12:00 of the next day... you
    have an arithmetic series:

     day hour lapse
     ---+--------+------
      0 00:00 00
      0 18:00 18
      1 12:00 36
      2 6:00 54
      2 24:00 72

    So you get a three days cycle. How to put that into crontab: "I'll leave
    that as an exercise for the reader", translated as "I feel lazy" :-p

    [...]

    Alternatively, what the original poster said, is to have the script run
    every day at hours 00, 6, 12, 18 and 24 (00), but check at the start when
    was the last time it run, calculating the time diference.

    Ie, the first time it would run at 00:00 hours, and would save a flag file
    somewhere stating that fact. The next cron job would start at 06:00, read
    the flag file, notice the time lapse not being 18 hours, ant exit. Same
    thing at noon, but at 6 PM the time lapse would be correct, it would run,
    and then, modify the flag file.

    Right? :-)

    -- 
    Cheers,
           Carlos Robinson
    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Carlos E. R.: "Re: [SLE] reply-to settings"

    Relevant Pages

    • Re: cron jobs not done during sleep
      ... First thing in your script look for a flag file indicating last time ... If the flag file does exist compare dates. ... they must first drive mad. ...
      (freebsd-questions)
    • Re: Newbie to logon scripts - how to make a script run once only?
      ... script can check for the existence. ... The logon script would check for the existence of the flag file. ... nature of the flag file depends on the deployment. ...
      (microsoft.public.windows.server.scripting)
    • Re: [SLE] Pullin my hair out... arrrgh
      ... Typical sysadmin approach, I think. ... "I feel lazy" part. ... > the flag file, notice the time lapse not being 18 hours, ant exit. ...
      (SuSE)
    • Re: Application to be called - runas Administrator
      ... you can run the script through MS script encoder, ... >I don't believe you can compile a vbscript - this information was passed on ... This flag file would be checked for presence in the ... >> beginning of the compiled program to bypass if it had already been run on ...
      (microsoft.public.scripting.vbscript)
    • Re: [SLE] cron.daily
      ... > The main script gets run every 15 minutes. ... NO math is performed, cron runs when instructed. ... > This ensures that each flag file is deleted, if the machine is running at ... boot your machine at 8:10 run-crons will still run at 8:15 -not- at ...
      (SuSE)