everyday we are doing so many things in linux.
meaning I have to restarting tomcat server everyday in my office.
i feel bore every day restarting tomcat server.
so i written a script which will restarts tomcat server automatically when it uses maximum RAM.
later i added this script into cron.
Cron is a daemon to execute scheduled commands
How to add scheduled commands into cron:
1.in terminal type following command to add a new job to your cron
$crontab -e
2.Then it will show following line.
# m h dom mon dow command
3.here 'm' for minutes,'h' for hours, 'dom' is day of month,'mon' is month number,'dow' is day of
the week.
4.you should specify time,date of your scheduled commands.
I specified my tomcat restarting scheduled command like this:
0,10,20,30,40,50 * * * * sh ~/auto_tomcat_restart.sh
So here 0,10,20,30,40,50 means every 10 minutes it will run the script (auto_tomcat_restart.sh) file.
Monday, August 6, 2007
Subscribe to:
Posts (Atom)