/etc/daily
I just found out about a shell script /etc/daily that mac users recommend running daily or weekly. It supposedly removes old system messages and junk. Does OS X invoke this script automatically every so often or must it be manually invoked? Is it very necessary?
cscgal
The Queen of DaniWeb
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
I'm not sure if I am answering my own question or not, but I just checked the crontab and it shows
/usr/sbin/periodic daily
/usr/sbin/periodic weekly
/usr/sbin/periodic monthly
Are these synonymous with the /etc/daily and /etc/monthly scripts? Thanks!
cscgal
The Queen of DaniWeb
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
Hello Dani,
Mac OS X is a *nix, and it has a crontab just like Linux and the rest of them. If you take a look at /etc/crontab, it will show you that these scripts are called regularly.
Here is mine:
yoda:/etc Christian$ cat crontab
# /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour mday month wday who command
#
#*/5 * * * * root /usr/libexec/atrun
#
# Run daily/weekly/monthly jobs.
15 3 * * * root periodic daily
30 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly
The order of the colums are:
MINUTE HOUR DAY MONTH WEEKDAY USER "ACTUAL COMMAND"
So, according to my line, I am running the daily at 3:15am (the times are in 24 hour clocks), the weekly runs on a Saturday (1=Mon, 2=Tue, 6=Sat), and the monthly happens on the 1st of the month, at 5:30 in the morning.
Yes, these are just like the familiar /etc/daily and /etc/monthly that you are familiar with.
Honestly, nearly all of the Mac users out there will not be aware of these files, and what they do. Apple has done well keeping things GUI based, but for us intense computer people, the Unix kernel is well... sexy. :)
Great question Dani. Good to see ya.
Christian
kc0arf
Posting Virtuoso
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
Oh poo. You got me all backwards. I come from a linux world TO the mac. Therefore, I am completely familiar with crontab. It is the /etc/daily and /etc/monthly I know nothing about! :) See, here's what happened ...
I was reading up in some mac forum earlier today about /etc/daily and /etc/mothly
I figured I would investigate what these scripts did so I used more/less to view em
I started this thread and posted asking what these files did
They seemed like stuff that would run all the time, so I took a looksie at my crontab to see if they were in there
I saw my crontab contained "periodic daily", etc, so my question was whether this periodic program invoked the scripts that were in /etc/
At this point, I posted my second post in this thread ;)
cscgal
The Queen of DaniWeb
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
yes they are. download yourself "anacron", a faceless app that
automates the daily/weekly etc. and runs in idle time.
redage
Junior Poster in Training
51 posts since Mar 2006
Reputation Points: 10
Solved Threads: 1