#!/usr/bin/bash

#Tate:2022.3.28
#Author:Yingjian
#function: 定时检测130nfs服务器存活
#env
Date2=`date +%F`
Date=`date +%Y%m%d_%H_%M`
IP=130

ping -c 1 192.168.233.$IP  &>/dev/null
if [ $? -eq 0 ];then
echo "$Date 130nfs服务存活 " >>/var/log/${Date2}check_130nfs.log
else
echo "$Date 130nfs服务宕机 正在切换到nfs 备份服务器" >>/var/log/${Date2}check_130nfs.log
umount -lf /usr/local/tomcat/webapps/ZunShangERP2-2.0/upload && mount -t nfs 192.168.30.47:/data/upload /usr/local/tomcat/webapps/ZunShangERP2-2.0/upload
fi
