[Linux] 리눅스 서버시간 수정하기( date / rdate )
이해하기 힘들지만, 시간을 설정해도 2~3분정도씩 시간이 다르게 나오는 경우가 발생합니다.
그래서, 매일 시간을 설정하는 옵션을 줘봅니다.
1) 시간 동기화
#rdate -s time.bora.net && hwclock -w |
5 3 * * * rdate -s time.bora.net && hwclock -w |
매일 자정에 시간을 설정하는 스케쥴링 설정한 예입니다.
[ 서버와 H/W 시간 수정 ]
1. clock : CMOS에서 있는 시간으로 서버 시간 수정.
#date MMDDhhmmYYYY -> 시간설정
ex)#date 072316012006 ->2006-07-23 16:01으로 수정.
3. rdate: 원결타임 서버로 부터 날짜시간 정보 구하기
#rdate [-p][-s][-u][-l] [타임서버]
ex)#rdate -s time.bora.net
#crontab -l
00 01 * * * /usr/bin/rdate -s time.bora.net && /sbin/clock -w
참고: http://blog.naver.com/forspeed4?Redirect=Log&logNo=130037695944
[ 원격 시간 받아오기 ]
rdate (시간 동기화), NTP: http://mslee89.tistory.com/74
가끔 rdate -su time.bora.net
으로 시간 세팅할떄 name or service... 어쩌고저쩌고 하면서 세팅이 안되는 경우가 있다.
이때는 time.bora.net 의 ip 로 세팅하면 되더라.
rdate -su 203.248.240.14
(출처: http://blog.naver.com/tainow/120142260183 )
[출처] time.bora.net 리눅스 시계세팅시 에러날때|작성자 김태형
[ rdate 시간 설정 ]
동기화 할 시간 화면에 보이기 (-p)
rdate -p time.bora.net |
동기화될 시간에 대한, 시간을 화면에 보여주는 옵션입니다.
#man rdate 내용중에..
OPTIONS
-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.