监控svn的脚本

# vi svn.sh
 
#!/bin/bash

Port=`netstat -ntpl | grep svnserve | awk -F[:" "]+ '{print $4}'`
if [[ $Port == "3690" ]];then
echo "svn is running at time:`date +%y/%m/%d-%H:%M`" >> /usr/local/apache/logs/svn.log
else
echo "svn is down at time:`date +%y/%m/%d-%H:%M`" >> /usr/local/apache/logs/svn.log
/usr/bin/svnserve  -d -r /date_web/subversion
fi
 

 
:wq
 
 
注:写时千万注意空格