代码如下: * */1 * * * /etc/init.d/ntpd status;if [ $? -ne 0 ];then /etc/init.d/ntpd start; fi 转载于:https://www.cnblogs.com/music378/p/7357363.html