时间同步

#!/bin/bash
Server_Stat=`ps -ef|grep -E "SO2GameSvr|Jx2wzGameSvr"|grep -v "grep"|wc -l`
if [ $Server_Stat -eq 0 ]
then
echo `date +%Y_%m_%d_%H:%M` >> /var/log/Update_time.log
ntpdate -u cn.pool.ntp.org >> /var/log/Update_time.log && hwclock --systohc
else
echo "`date +%Y_%m_%d_%H:%M`_Please stop the server first!!!" >>  /var/log/Update_time.log
fi
exit 0


你可能感兴趣的:(server)