時間同步

#!/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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章