Re: [SLE] cron.daily

From: Ken Schneider (suse-list_at_bout-tyme.net)
Date: 03/05/05

  • Next message: Jeffrey L. Taylor: "Re: [SLE] Backup using Amanda"
    To: SLE <suse-linux-e@suse.com>
    Date: Fri, 04 Mar 2005 23:22:14 -0500
    
    

    On Fri, 2005-03-04 at 21:26, Carlos E. R. wrote:
    > The Friday 2005-03-04 at 13:46 +0100, Anders Johansson wrote:
    >
    > > On Friday 04 March 2005 13:33, Richard Bos wrote:
    > > > Does anyone know when the scripts in /etc/cron.daily are being executed?
    > > > It is of course once a day, but just when. Are the scripts examined every
    > > > minuted by /usr/bin/cron? If so does it mean that the scripts
    > > > in /etc/cron.daily could be executed just after booting? Just wondering.
    > >
    > > Have a look at /etc/crontab, that's where it's run from.
    > ...
    > > so it gets run at 4.15 in the morning
    >
    > Actually, it is a bit more complex than that :-)
    >
    > The first line found in crontab is:
    >
    > -*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
    >
    > The main script gets run every 15 minutes. Then, it does some math to see

    NO math is performed, cron runs when instructed.

    > when each section (hourly, daily, etc) was run - and if the proper
    > interval has passed, all the scripts in the corresponding directory are
    > executed.
    >
    >
    > 59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
    > 14 4 * * * root rm -f /var/spool/cron/lastrun/cron.daily
    > 29 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
    > 44 4 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly
    >
    > This ensures that each flag file is deleted, if the machine is running at
    > that time. For example, the hourly flag is deleted at the 59th minute of
    > each hour; the daily at 4:14, the weekly at 4:29, the monthly at 4:44...
    >
    > Those will be the hours they run, I think, if the machine is on
    > continuously - well, when the next 15 minutes interval completes, I think.
    >
    > If the machine is not on 24*7, the run-crons script runs 15 minutes after
    > booting.

    Wrong. It runs every 15 minutes starting at the top of the hour. If you
    boot your machine at 8:10 run-crons will still run at 8:15 -not- at
    8:25, 15 minutes after you booted.

    > The daily section will run then if it hasn't run in the previous
    > 24 hours,

    Incorrect it will -only- run at 4:15am if the machine is on. The only
    way it will run at some other time is if you shut the machine down after
    4:14am, when the daily check file has been deleted and before the 4:15am
    run of run-crons.

    > and then again sometime after 4:14 if it still on ... or
    > something of the sort, I'm to sleepy to think. I'm off! O:-)
    >
    > --
    > Cheers,
    > Carlos Robinson

    -- 
    Ken Schneider
    UNIX  since 1989, linux since 1994, SuSE  since 1998
    * Only reply to the list please*
     "The day Microsoft makes something that doesn't suck is probably
      the day they start making vacuum cleaners." -Ernst Jan Plugge
    -- 
    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: Jeffrey L. Taylor: "Re: [SLE] Backup using Amanda"

    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
      ... > story of the donkey that needed a 2x4 in the head to get its attention so it ... Alternatively, what the original poster said, is to have the script run ... Ie, the first time it would run at 00:00 hours, and would save a flag file ... the flag file, notice the time lapse not being 18 hours, ant exit. ...
      (SuSE)
    • Re: Need help with PHP & SQL code, new to this.
      ... > I am trying to pull a time stamp out of a database,looks like this ... Why not just do the math on ... - assigning each to a variable within your script. ... date/time string below for ease, but you would populate them using the ...
      (comp.lang.php)
    • Re: math.sqrt() in new 3.0 version : solution in input()
      ... >>> import math ... An entry of 9 or 9.0 will yield 3.0 ... Yet the same code in a script gives an error message ... Some thought I was not using the Python 3 command line. ...
      (comp.lang.python)