I'm using this script (I think I got it off of WHT) to restart httpd whenever a file failed to download on my server.
I have it on crontab
but it didn't seem to restart httpd, I got no e-mail and our site was down for several hours.
Is there anything wrong with the script?
Thanks
Code:
#!/bin/bash
FILE=http://www.domain.tld/test.file
rm -f test.file
wget -q $FILE -O test.file
if [ ! -f test.file ]
then
/etc/init.d/httpd restart
echo 'ALERT - HTTPD restarted on:' `date` | mail -s "Alert: HTTPD Restarted" [email protected]
fi
exit $?
I have it on crontab
Code:
*/5 * * * * /bin/nfup > /dev/null 2>&1
but it didn't seem to restart httpd, I got no e-mail and our site was down for several hours.
Is there anything wrong with the script?
Thanks












