CentOS 시간대 변경
# cp /etc/localtime /etc/localtime.ori <-- 원래 시간 정보를 복사해놓고...필요는 없는데...습관
# cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime <-- 원하는 시간대의 정보를 복사해온다. 한국은 Seoul 이죠 (링크가능)
cp: overwrite `/etc/localtime'? Y
# date
Mon Nov 10 10:35:50 JST 2011 <--- 바꼇다
이제 시간대가 바꼇습니다.
이제 시간 동기화
# ntpdate
-bash: ntpdate: command not found
안깔렸네요...
# yum install ntpdate
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: mirror.its.sfu.ca
* epel: mirrors.cat.pdx.edu
* extras: mirror.its.sfu.ca
* updates: mirror.its.sfu.ca
53 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.4p8-2.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================
Package Arch Version Repository Size
=============================================================================================================
Installing:
ntpdate x86_64 4.2.4p8-2.el6 base 58 k
Transaction Summary
=============================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 58 k
Installed size: 74 k
Is this ok [y/N]: y
Downloading Packages:
ntpdate-4.2.4p8-2.el6.x86_64.rpm | 58 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ntpdate-4.2.4p8-2.el6.x86_64 1/1
Installed:
ntpdate.x86_64 0:4.2.4p8-2.el6
Complete!
설치가 됐고
# ntpdate -b time.kriss.re.kr
10 Nov 17:36:37 ntpdate[23926]: step time server 210.98.16.100 offset -0.067600 sec
# clock -w
cmos로 시간을 넣습니다.
# clock
Sun 10 Nov 2011 05:38:25 PM JST -0.688055 seconds
크론 등록
# vim /etc/crontab
00 05 * * * root ntpdate -b -s time.kriss.re.kr && clock -w
# /etc/init.d/crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
최근 덧글