I have a cron entry which suppose to run a script. This is a simple script which only stops and restarts tomcat.I need to do this because the Database sits on different machine and due to weekly schedule reboot of DB box,app lose connection,hence i need to restart the tomcat.
I tried to test my cron entry multiple time yesterday but it failed.
echo "App Servers shutting down..."
mvn fc:service-stop -DserviceNames=tomcatReport03
mvn fc:service-stop -DserviceNames=tomcatnotif02
mvn fc:service-start -DserviceNames=tomcatnotif02
mvn fc:service-start -DserviceNames=tomcatReport03
echo " App being restarted"
i tried it testing yesterday and entry was:
10 10 * * * 4 /local/notif/scripts/Weeklyrebootscript.sh
It failed, and i checked mail and found below error:
/bin/sh: 4: command not found
Then i changed first line to #!/bin/sh -x,but still same error.
If i run the script on command line its works fine.
Could you please help how i can get this cronjob working? . Its redhat linux 5.5 (Tikanga).