OS/CentOS
rdate 시간 동기화
구닥다리 엔지니어
2014. 4. 11. 11:08
rdate 명령을 이용해 시간을 동기화 할 수 있다.
OPTION
-p Print the time returned by the remote machine.
-s Set the system time to the returned time.
-u Use UDP instead of TCP as the transport.
-l Use syslog to output errors (cron.warning) and output (cron.info).
-t Set timeout in seconds for every attempt to retreive date.
주기적으로 시간을 동기화 하기 위해서는 crontab에 다음과 같이 등록하여 동기화할 수 있다.
0 0 * * * root rdate -su time.bora.net | clock -w
-u : 전송수단으로 TCP 대신 UDP를 사용
rdate를 이용해 time 서버로부터 시스템 시간을 동기화 한 후 clock -w 명령을 이용해 시스템 시간을 CMOS 시간으로 설정한다.
clock -s : CMOS 시간을 시스템 시간으로 설정