### squid daemon 자동실행 스크립트 ###
>cat /etc/crontab
*/1 * * * * root sh /root/bin/squidcheck.sh
>
>cat /root/bin/squidcheck.sh
#!/bin/bash
# squid demon check
PS=`/usr/bin/pstree |grep squid`
NOW=`date +'%Y-%m%d-%H%M'`
if [ "$PS" == "" ]; then
echo "[$NOW] squid died...." >> /var/log/squid/squid-check.log
/usr/local/squid/sbin/squid
else
echo "squid running"
fi
echo "[$NOW] squid died...." >> /var/log/squid/squid-check.log
/usr/local/squid/sbin/squid
else
echo "squid running"
fi
댓글 없음:
댓글 쓰기