Power User Monday Tip of the Week
Scheduling Your Mac
By: Jon Gales
Back in the OS 9 days it was pretty hard to put your beloved Mac on a schedule. Now with OS X's Unix underbelly, it's easy as 1, 2, configure. The Unix utility Cron is built into OS X, and can automate most anything. Here's a quick intro:
Cron is a daemon (program that's always running) that processes crontab files. Each user has a crontab file. It's a very simple format, but it has to be exactly right:
minute hour day month weekday command
That's not so bad is it? Put a * when you want it to occur every time. For example, if we want a job to process at 1PM every day this would be the crontab:
0 13 * * * command
Now, here is where it stars to get useful... Meet your new favorite command.
open => used to open applications or web URL's. Here are some examples:
'open /Applications/' opens the Applications folder in the Finder
'open -a TextEdit /foo.txt' opens foo.txt in TextEdit.
'open http://www.macmerc.com/' opens the URL in your default browser.
so if you have tab browsing and set new links to open a new tab, you can set your computer to queue a few sites for you in the morning:
0 7 * * * open http://www.macminute.com
0 7 * * * open http://www.cnn.com
0 7 * * * open http://www.mobiletracker.net
At 7AM you'll get met with three tabs of goodness. Fun! You can do more with this though–it's not just opening apps. Any command you can do in the terminal can be put on a schedule. You can even run Applescripts by using the command "osascript".
Now, how to actually write your own crontab file. You can do it manually from the Terminal by typing crontab -e, but I suggest using the free Cronnix. It labels what column is what which is really handy if you don't do it every day.
All personal comments should be sent to the author. All other discussion should be done in the Forums
[ Back to Power User Monday Tip of the Week | Sections Index ]





