Skip navigation
This discussion is archived

When does /etc/daily.local run?

7198 Views 18 Replies Latest reply: Jan 30, 2009 7:51 PM by Network 23 RSS
1 2 Previous Next
gvde Calculating status...
Currently Being Moderated
Jan 29, 2009 5:24 PM
When does a shell script in /etc/daily.local run? I thought it runs at 3:15 AM every day if the computer is on at that time. If it is off, it will run the next time the computer is running. But actually the script (and none of the other /etc/periodic/daily scripts) is never executed.

Can it be that the script only runs delayed if the computer is sleeping and not if it is completely shut down??
iMac, MacBook, Mac OS X (10.5.6)
  • V.K. Level 9 Level 9 (56,120 points)
    Currently Being Moderated
    Jan 29, 2009 5:52 PM (in response to gvde)
    gvde wrote:
    When does a shell script in /etc/daily.local run?


    you mean scripts in /etc/periodic/daily, right? i have no /etc/daily.local on any of my computers. is this something you added yourself?
    I thought it runs at 3:15 AM every day if the computer is on at that time. If it is off, it will run the next time the computer is running. But actually the script (and none of the other /etc/periodic/daily scripts) is never executed.

    how do you know that? look in /var/log/daily.out (you can access it from Console). what does it say?

    Can it be that the script only runs delayed if the computer is sleeping and not if it is completely shut down??

    no, it should run the first chance it gets on computer power up.

    Message was edited by: V.K.
    Mac Pro 3.2 GHz, Mac OS X (10.5.6), Mac Pro 2.66GHz, powerbook G4 1.5GHz
  • b99 Level 2 Level 2 (280 points)
    Currently Being Moderated
    Jan 29, 2009 7:30 PM (in response to V.K.)
    I leave my computer on all week letting it sleep overnight, except for Saturday night and Sunday when I turn it off completely. I see in my daily.out files that it runs the daily script every day when I wake the computer up, but there is no daily.out entry for the Monday's when I power it up. For the nights when I have forced it to stay awake (doing a long job) it executes daily.out at 3:15 am.
    Mac mini (intel), Mac OS X (10.5.5), 320 GB, ACD 23"
  • V.K. Level 9 Level 9 (56,120 points)
    Currently Being Moderated
    Jan 29, 2009 7:33 PM (in response to b99)
    there have been a lot of debate about it on this forum and I've seen a number of claims by people who shut down their computers overnight that daily scripts run the next morning. that's what i was basing my response on. I never shut down my mac and sleep it only so I can't confirm this personally.
    Mac Pro 3.2 GHz, Mac OS X (10.5.6), Mac Pro 2.66GHz, powerbook G4 1.5GHz
  • V.K. Level 9 Level 9 (56,120 points)
    Currently Being Moderated
    Jan 29, 2009 8:03 PM (in response to gvde)
    gvde wrote:
    you mean scripts in /etc/periodic/daily, right? i have no /etc/daily.local on any of my computers. is this something you added yourself?


    /etc/daily.local is standard Apple. It is called from /etc/periodic/daily/500.daily.

    you are quite right. I looked inside /etc/periodic/daily/500.daily and /etc/daily.local should be executed if it exists when the daily script runs.

    I thought it runs at 3:15 AM every day if the computer is on at that time. If it is off, it will run the next time the computer is running. But actually the script (and none of the other /etc/periodic/daily scripts) is never executed.

    how do you know that? look in /var/log/daily.out (you can access it from Console). what does it say?


    daily.log does not say anything. It is dated January 2nd, 3:15. Nothing since then.

    The script currently only appends the output of "date" to a file which is writable for all users. There is nothing in this file added.

    ok then. as I said in my other reply in this thread this subject has been oft debated on this forum and i've seen a number of people who shut down their computers overnight saying that their daily scripts still run. that's what i was basing my response on. I never shut down my macs myself. It could indeed be that daily script doesn't run if the computer is shut down overnight. I'm going to make /etc/daily.local file and shut down my mac tonight we'll see what happens.
    In the meantime you can either sleep your mac instead of shutting it down or change the time the daily script should run to some time during the day while the computer is on.
    Mac Pro 3.2 GHz, Mac OS X (10.5.6), Mac Pro 2.66GHz, powerbook G4 1.5GHz
  • Jeffrey Jones2 Level 6 Level 6 (8,425 points)
    Currently Being Moderated
    Jan 29, 2009 9:15 PM (in response to gvde)
    There is virtually no reason to run periodic daily if the computer is restarted every day. The most significant thing the daily scripts do (in Leopard) is delete temporary files (in /tmp) that have not been accessed in at least 3 days. But /tmp is cleared as part of the startup process, so there will never be anything to delete on a system that is restarted frequently. The periodic scripts are mostly for "long-lived" systems, i.e., systems that have been up continuously for weeks or months at a stretch.
  • Jeffrey Jones2 Level 6 Level 6 (8,425 points)
    Currently Being Moderated
    Jan 30, 2009 11:30 AM (in response to gvde)
    Yes, there are 5 daily scripts. Here is what they do: (This list is complete only for Leopard.)

    100.clean-logs Looks for crash logs in /Library/Logs/CrashReporter. Deletes any that have not been accessed for at least 60 days. This is obviously not an urgent task.

    110.clean-tmps Delete temporary files in /tmp that have not been accessed for at least 3 days. As I said earlier, a system that is restarted frequently will never have any files affected by this.

    130.clean-msgs Delete system messages. This is relevant only for multi-user Unix systems.

    430.staus-rwho Writes a system status message (mainly system uptime) in the daily.out log. This is just reporting, not maintenance.

    500.daily This does several things:

    Delete rwho messages older than 7 days. This has to do with Unix networks, and is irrelevant for almost everyone.

    Delete fax scratch files older than 7 days. This is only relevant if you use your Mac as a fax machine.

    Finally, some accounting and system status information is written in the log.

    That's it, unless you or your system administrator have defined some local tasks. Unless you are running a Unix cluster or regularly using your Mac as a fax machine -- and shutting the machine down every night, without exception -- there is nothing urgent in the daily scripts.

    The weekly scripts update two databases, of interest only to Unix users. If you are not a Unix user there is never any reason to run weekly. The locate database is used by the locate command. If you are a regular user of locate, you should evaluate whether the index as built by weekly is complete enough for your purposes. The whatis database is an index of Unix man pages. It only needs to be rebuilt if you have installed new Unix documentation. In that case, the logical time to rebuild whatis is as part of the installation process, rather than waiting for the next weekly run. Again, if you are not a Unix user, you do not need to rebuild these databases at all.

    The monthly scripts may do two things. One is to write some accounting information in the monthly.out log. I don't think the relevant accounting mechanism is used anymore in Leopard, so this appears to be obsolete. It never does anything on my system, in any case. The second thing monthly does is to archive and recycle fax logs. If you do not use your Mac as a fax machine, it is never necessary to run monthly.

    Somewhere along the line someone applied the term "maintenance" to the periodic scripts, leading many to believe that they perform some crucial tasks. In fact, it is only minor housekeeping. And in Leopard, they really do run automatically if needed, and the housekeeping is more minor than ever.
  • nerowolfe Level 6 Level 6 (13,070 points)
    Currently Being Moderated
    Jan 30, 2009 11:48 AM (in response to gvde)
    gvde wrote:
    When does a shell script in /etc/daily.local run? I thought it runs at 3:15 AM every day if the computer is on at that time. If it is off, it will run the next time the computer is running. But actually the script (and none of the other /etc/periodic/daily scripts) is never executed.

    You were misinformed. If the computer is turned off during the time the scripts should run, they will not run when the computer is turned on. Only if the computer is sleeping will the scripts run when it wakes up.
    Can it be that the script only runs delayed if the computer is sleeping and not if it is completely shut down??

    Yes, that is absolutely correct. You will find words to the contrary if you google, but then, google, like Wiki, is not truth.

    You might consider adding the Maintidget widget and run them manually, as I do, if you really want them to run. They are relatively unnecessary, but I run them just the same although not on a regular basis. Just whenever the mood hits me

    Another reference for this is here:
    http://discussions.apple.com/thread.jspa?messageID=8387203&#8387203

    Message was edited by: nerowolfe

    Message was edited by: nerowolfe
    MacBookPro3,1-17"Core2Duo/VistaUlt64SP1; MacBookPro1,1-15"/XPProSP3; Dual G5/XPP, Mac OS X (10.5.6), Homebrew 3GHz ASUS PC, Dell Inspiron8k, Abacus, Sliderule, HP-50G
  • V.K. Level 9 Level 9 (56,120 points)
    Currently Being Moderated
    Jan 30, 2009 1:32 PM (in response to Jeffrey Jones2)
    thanks a lot for that info. it is quite helpful. I agree, none of this is urgent or necessary for most people.

    still, if someone really wants to run those periodic tasks anyway and they shut down their computers overnight the easiest thing to do is to change the scheduled times for the periodic tasks to occur some time during the day. this can be done by editing the periodic tasks plists located in /System/Library/LaunchDaemons.

    The easiest way to edit them is by using Lingon http://tuppis.com/lingon/ or Property List Editor.
    Mac Pro 3.2 GHz, Mac OS X (10.5.6), Mac Pro 2.66GHz, powerbook G4 1.5GHz
  • V.K. Level 9 Level 9 (56,120 points)
    Currently Being Moderated
    Jan 30, 2009 4:31 PM (in response to gvde)
    see my post above.
    Mac Pro 3.2 GHz, Mac OS X (10.5.6), Mac Pro 2.66GHz, powerbook G4 1.5GHz
1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.