A simple shell script to run system maintenance tasks

Dec 20, '06 07:30:00AM

Contributed by: Anonymous

I created this simple bash script to perform periodic maintenance. I put the script file in my ~/bin directory, and I added the folliwing line to my .profile file (where my_user is my short username):

  export PATH=$PATH:/Users/my_user/bin
Now, when I want to perform maintenance, I open a Terminal window and type maint at the prompt.

[robg adds: Remember to chmod 655 ~/bin/maint to make the code executable. We've had a number of hints here over the years dealing with the periodic maintenance scripts. There are also numerous utility apps that will do this for you as well.]

Comments (14)


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