#!/bin/bash
CHECK='server-release is not running ... failed!' #test string
STATUS=$(/home/user/server/server/build.sh status) #write the status of the server in a variable
if [ "$CHECK" == "$STATUS" ]
then
echo "server is stopped"
rm-f /home/user/server/server/server.pid
/home/user/server/server/build.sh startd
else
echo "server is worked"
fi
* * * * * /bin/bash /etc/starter.sh > /tmp/starter.log 2>&1
Find more questions by tags The task schedulersDebianbash
Half a day spent, it was necessary only to remove bash ( - Kaya commented on April 19th 20 at 12:14
yeah it happens , it is something that you specify the full path to the bash because Kron does not have the environment variable shell, and therefore does not run the command from bin by default.
But you have not answered the question why so difficult to check ? - keshawn_Hacke commented on April 19th 20 at 12:17