Restrict certain applications to certain times of day

Jul 10, '03 09:20:00AM

Contributed by: hmelton

I really need to keep working on my novel, but MacSolitaire is there in my dock, catching my eye and killing my productivity. I recently added this to my crontab, restricting my play to 6pm thru midnight:

######  Restrict time-killer applications
0 0-17 * * * chmod 000 /Applications/MacSolitaire
0 18-23 * * * chmod 644 /Applications/Macsolitaire
Of course this only works for applications owned by me and many are owned by root. However, you could use sudo chmod if you have turned off sudo passwords. For the line that turns the application back on, use the proper chmod to put it back like it was originally.

[robg adds: This is clearly an extreme example of enforcing self control, but it demonstrates a somewhat novel use for cron. There are a few hints here that discuss using cron, including a brief tutorial I wrote a couple years ago.]

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2003070314270650