As I'm looking, thought I'd list exactly what the nightly-task/cron tab is
doing.

[look at /etc/crontab first]

The directories:

/etc/periodic/daily/
/etc/periodic/weekly/
/etc/periodic/monthly/

each contain scripts that run when the time period in crontab occurs. They
have names like 500.daily and I suspect the lower filename alphabetically
[also numerically by lucky chance] is run first.

[the 500.weekly etc files appear to also be available as /etc/500.weekly
via the magic of sym-linking]

Config appears to be mainly in /etc/defaults/periodic.conf

daily:
  100.clean-logs    Deletes /Library/Logs/CrashReporter if 60 days old
  500.daily
     Clean /tmp, /var/rwho, system messages of various ages
     Backs up netinfo stats
     Rotate system log files
     Clean web server logs, over 7 days old

It also does a few optional things that aren't on my version and seems to
work a little to append a nice report of information, /var/log/daily.out.

weekly:
  500.weekly
    Rebuild locate and whatis databases. These are handy search tools for
      the Terminal.
    Rotate various log files in /var/log. Filewall, printer, mail, others.
    Rotate web server logs and restart web server

monthly:
  500.monthly
    Flush account logging (wtmp - binary)
    Rotates /var/log/wtmp and /var/log/install.log
    Restarts system-logging

For me, the only one of these that might be a bit scary is the restarting
of the web-server if it is on OS X server.


So my next thought is, does my laptop which rarely is alive at 3, 4 or 5
am [well, more often than many laptops, but still rare] really need these?
My last daily cron appears to have run on Apr 18th. Looking at archived
files, it looks like it gets to run once every week or two.

Most of the nightly work done is in /var/log. The largest file I currently
have in there is the 300 kilobyte install.log. So not important.

Sub-directories of that directory contain other logs.
The largest is 293k in the web server's log. I have my machine's web
server set as my home page to serve documentation, so seems to not be
hurting too much. This file has never been rotated etc, which suggests I
think that my weekly cron has never run.


So, given what I'm seeing in these scripts, and what my current system
looks like, I'd be surprised if the average user needs to care much about
the nightly tasks. It's petty change.

----

I found one interesting thing out while taking a rare leisurely stroll
through the undergrowth of my Mac. Apple seems to keep its swap file
[using the hard drive as extra memory for emergencies] in /var/vm/. I seem
to have 2 64M ones and a 128M one. Wonder why, the one thing this laptop
shouldn't need more of is memory.

Hen

On Tue, 27 Apr 2004, Lee Larson wrote:

> On Apr 27, 2004, at 2:07 PM, Bill Holt asked:
>
> > Second "can't find" - there is a way, I know, to have the OSX system
> > do it's
> > self-repair thing on a schedule of my choosing instead of it's wee
> > hours of
> > the morning preference.  I know I've read about it here ... but can't
> > find
> > it because that exchange is in my archive.  Can't even find it on the
> > apple
> > site ... probably because I don't have enough of a clue to ask the
> > question
> > intelligently.
>
> There's probably a nice GUI program somewhere to let you change the
> times, but I've never looked for one. It's actually not very
> complicated, if you're willing to use a text editor.
>
> If you look at the file /etc/crontab, you'll see near the end
>
> # Run daily/weekly/monthly jobs.
> 15      3       *       *       *       root    periodic daily
> 30      4       *       *       6       root    periodic weekly
> 30      5       1       *       *       root    periodic monthly
>
> These three lines tell when the periodic maintenance scripts are
> executed. The columns stand for
>
> minute  hour    monthday    month   weekday    owner     command
>
>  From this, we see that the run times are
>
> daily  3:15 AM
> weekly 4:30 AM on Saturday (Monday is 1)
> monthly 5:30 AM on the first of the month
>
> With a text editor, you can change them to run whenever you want.
>
> To learn more about this than you'll ever need to know, open up a
> terminal window and read the documentation by typing
>
> man 5 crontab
>
>
>
>
>
>
> | The next meeting of the Louisville Computer Society will
> | be April 27. The LCS Web page is <http://www.kymac.org>.
> | List posting address: <mailto:macgroup at erdos.math.louisville.edu>
> | List Web page: <http://erdos.math.louisville.edu/macgroup>
>



| The next meeting of the Louisville Computer Society will
| be April 27. The LCS Web page is <http://www.kymac.org>.
| List posting address: <mailto:macgroup at erdos.math.louisville.edu>
| List Web page: <http://erdos.math.louisville.edu/macgroup>


Reply via email to