SmallStyle


2007-04-19

_ サーバの時刻あわせ

サーバの時刻あわせのために ntpdate をインストール

$ sudo apt-get install ntpdate
$ sudo ntpdate xxx.xxx.xxx.xxx
22 Apr 21:54:19 ntpdate[18806]: adjust time server xxx.xxx.xxx.xxx offset 0.229080 sec

定期的に時刻あわせをするために,cron に登録しておく.実行スクリプトは次のものを利用.

#!/bin/sh
/usr/sbin/ntpdate -s xxx.xxx.xxx.xxx

こいつを /etc/cron.hourly あたりに保管する.これで 1 時間ごとに時刻あわせが実行される.ちなみに -s オプションは syslog に実行ログを出力する設定.


about me

いろいろと興味を持ったことを書いてます.ちょっとしたことは hb(@smallstyle) on Twitter で書いてます.

Archive

2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|12|