Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

OS X and scheduled tasks UNIX
When you first install OS X, it won't have all the UNIX commands available. Specifically, "whatis," "man -k," and "locate," all of which are useful for beginners (like me!) will not be there.

Respectively, "whatis" provides a one-line description of a command, "man -k [keyword]" finds all instances of [keyword] in the manual pages, and "locate [fname]" shows you where [fname] is in the directory structure.

A cron (UNIX scheduler program) task needs to be run to create these databases. Unfortunately, it won't run until the end of the first week, assuming you leave your machine on the whole time.

You can force an immediate update, though, by following these steps from a terminal session:
su root
cd /usr/libexec
./makewhatis {-- takes a few seconds to run --}
./locate.updatedb {-- takes up to a few minutes to run --}
exit

The above commands will now work as expected.
    •    
  • Currently 1.71 / 5
  You rated: 1 / 5 (17 votes cast)
 
[28,457 views]  

OS X and scheduled tasks | 3 comments | Create New Account
Click here to return to the 'OS X and scheduled tasks' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
OS X and scheduled tasks
Authored by: atoms on Oct 29, '03 08:42:57AM

This hint works fine in Panther, not that it should be any surprise given that this is straight up UNIX.

locate is not just for beginners either. I've been using UNIX on and off for ten years or so, and I still find uses for locate.

Even more importantly, the awesome wgetCocoa needs an updated locate db if you just recently (re)added wget to your system.

Thanks for the great hint - still useful after three years!



[ Reply to This | # ]
OS X and scheduled tasks
Authored by: squirri on Jul 15, '06 12:25:49PM

I had to use sudo to get the commands to work - I got a permission denied error without using sudo.

Neat hint though



[ Reply to This | # ]
OS X and scheduled tasks
Authored by: spud_upb on Nov 17, '06 12:31:09PM

You can also just force the appropriate weekly cron task to run. Simply open the terminal and :

sudo /etc/weekly

You can also do this for:

sudo /etc/daily
and
sudo /etc/monthly

---
"God set definite bounds on man's wisdom,
but put no limits on his stupidity."



[ Reply to This | # ]