#!/bin/bash ntpServer=$NTP_SERVER if grep -q "/sbin/hwclock -w) &> /var/log/ntpdate.log" /etc/crontab then echo "The cron job is setted for NTP SERVER!" exit else echo "*/10 * * * * root (/usr/sbin/ntpdate $ntpServer && /sbin/hwclock -w) &> /var/log/ntpdate.log" >> /etc/crontab #restart the cron /etc/init.d/crond restart fi
主机与ntp时间同步脚本
最新推荐文章于 2024-06-02 09:31:32 发布