I am in the need of restarting tomcat everyday @midnight.
I have no idea in writing scripts in centos .
Basically looking for a script that will execute following commands every 24 hr for the files located in /tomcat/bin/ :
If tomcat is installed as a service, you should be able to use a cronjob call those scripts at midnight every night. There's a tutorial on how to use crontab here: https://help.ubuntu.com/community/CronHowto
This answer has an example for midnight crontab: cron that will run a ruby script every day at midnight
If the service doesn't work, you could use
00 00 * * * bash -c '/tomcat/bin/shutdown.sh && /tomcat/bin/startup.sh'
I don't have somewhere to try it, so that's the best I can give you.