I have this teamspeak server that has a bad habit of crashing sometimes. Therefore I would like to run a script every 5 minute so the server can restart even if I'm not home. I got this script, and it's executable (chmod +x), but it doesn't seem to be running, I added some echos to confirm if it runs and if it fail or succeed, but I get no response, I can't get anything from the log either. ( /var/log/cron )
#!/bin/sh VALID_CHECK="Server seems to have died" RESULT=`/home/zuusu/teamspeak3-server_linux-x86/ts3server_startscript.sh status` TEST_CHECK="Server is running" /bin/echo "Initiating Server Check" if [ "$RESULT" == "$TEST_CHECK" ]; then /home/zuusu/teamspeak3-server_linux-x86/ts3server_startscript.sh status /bin/echo "Server Restarted" else /bin/echo "Server Check Done" fi
Here is the line from crontab:
*/5 * * * * /home/zuusu/teamspeak3-server_linux-x86/server_check.sh
I used readlink to get the full path.
[root@forum teamspeak3-server_linux-x86]# readlink -f server_check.sh /home/zuusu/teamspeak3-server_linux-x86/server_check.sh
As you probably notice I'm pretty novice in linux, but I have some experience with programming.
Does this look fine to you guys? Why isn't it working?