Hi, I have problems with newcs, and I need a check and restart script for newcs via cron. This script need to check newcs every 5 minuts and if it down, to restart it.
I try to do it with this script:
#!/bin/bash
if ps -ef | grep newcs | grep -v grep ; then
echo && date>> /var/log/newcs.ok
else
/usr/local/bin/newcs &
echo && date>> /var/log/newcs.restart
fi
I named this script newcscheck.sh and gave atributes 755
and I add a cronjob:
*/1 * * * * /var/script/newcscheck.sh
What's wrong?
Thanks in advance