User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Darwin, X11 and BSD section within the Tech Talk category of DaniWeb, a massive community of 427,674 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,258 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Darwin, X11 and BSD advertiser: Programming Forums
Views: 5313 | Replies: 7 | Solved
Reply
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,946
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 116
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

/etc/daily

  #1  
Apr 23rd, 2004
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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,946
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 116
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: /etc/daily

  #2  
Apr 23rd, 2004
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!
Reply With Quote  
Join Date: Mar 2004
Posts: 1,514
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Rep Power: 10
Solved Threads: 49
Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: /etc/daily

  #3  
Apr 23rd, 2004
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
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,946
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 116
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: /etc/daily

  #4  
Apr 23rd, 2004
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
Reply With Quote  
Join Date: Mar 2005
Posts: 4
Reputation: Warren Oates is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
Warren Oates Warren Oates is offline Offline
Newbie Poster

Re: /etc/daily

  #5  
Mar 13th, 2005
Originally Posted by cscgal
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

In the Old Unix World, the machines were left on all the time, and they scheduled cron to run litle cleanup tasks at odd hours, when they reckoned that the users would be in bed or at the pub or somewhere. What these scripts do is rotate your logs, delete the ones that are out of date, update the locate and whatis databases, do some obscure system maintenance, all good stuff.

In the New Unix World, where OS X is in the homes of folk who feel the need to save the planet by turning off their computers whenever they go to the store to buy some milk, the cleanup scripts don't get run as often as they should. This isn't really a problem unless you rely on locate to find stuff, and if you do, you probably update it manually anyway. The logs should be rotated to save space, but in this era of 250 gig drives, that's not much of an issue either.

These are are executable files, you can run:

[~] sudo /etc/weekly

for instance anytime you want, and have that cleanup stuff done for you.

There was a freeware thing called XJanitor that let you do this stuff, but I'm not sure who designed it ... aha, it's the same guy that distributes Brickhouse:
http://personalpages.tds.net/~brian_...acjanitor.html

Warren.
Reply With Quote  
Join Date: Sep 2004
Posts: 555
Reputation: yellow is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 5
yellow's Avatar
yellow yellow is offline Offline
Posting Pro

Re: /etc/daily

  #6  
Mar 14th, 2005
To run the scripts by hand, do:

sudo periodic <script>

Where <script> should be replaced by daily, weekly, monthly, or any combo thereof.. example:

sudo periodic daily weekly

This will run my /etc/daily (and /etc/daily.local) as well as my /etc/weekly (and /etc/weekly.local) scripts..
Reply With Quote  
Join Date: Mar 2006
Posts: 42
Reputation: redage is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
redage redage is offline Offline
Light Poster

Re: /etc/daily

  #7  
Apr 27th, 2006
yes they are. download yourself "anacron", a faceless app that
automates the daily/weekly etc. and runs in idle time.
Reply With Quote  
Join Date: Sep 2004
Posts: 555
Reputation: yellow is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 5
yellow's Avatar
yellow yellow is offline Offline
Posting Pro

Re: /etc/daily

  #8  
May 2nd, 2006
Originally Posted by redage
yes they are. download yourself "anacron", a faceless app that
automates the daily/weekly etc. and runs in idle time.


There's no more need for this if one is running Tiger (or later), as cron has been supplanted by launchd, which operates in a more efficient manner. Launchd will run the appropriate script at the appropriate time available.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Darwin, X11 and BSD Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Darwin, X11 and BSD Forum

All times are GMT -4. The time now is 11:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC