Syncronizing your current date and time is as important as making database backups. Without proper accurate stamped date and time, any backup file with any stamped date on it would be meaningless. Without correct time and date, those scripts that depend on date and time schedule would be executed inaccurately and would give you result on a wrong date and time stamp.
There are many ways to adjust, correct and synchronize your system date and time via terminal. Changing and syncing hardware and system clock has been covered from recent entry which can be found here.
If you happen not to have any local NTP server from your network, here's an entry to update, set and adjust your system date and time from external NTP servers around the globe using ntpdate and rdate.
How to synchronize system date and time from NTP pool servers around the web. Do as follows.
Assuming we would like to sync our system date and time with 2.fedora.pool.ntp.org NTP time pool server. This blog entry covers doing it using ntpdate linux command via terminal.
Ntpdate man says:
ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs. Makes use IPv4 and IPv6 on adjusting system date and time.
Getting the current system date and time is needed for comparison values.
# date
Now let us proceed.
SYNCING WITH NTP SERVER MANUALLY
================================
How to synchronize system date and time with NTP time server using ntpdate?
# ntpdate 2.fedora.pool.ntp.org
Alternative time pool servers are:
~~~~~~~~~~~~~~~~~~~~~~~~
0.fedora.pool.ntp.org
1.fedora.pool.ntp.org
time.nist.gov
~~~~~~~~~~~~~~~~~~~~~~~~
If you wish to query date and time only, this would be done like so
# ntpdate -q 2.fedora.pool.ntp.org
If you have a local time server near to your network, this would be
# ntpdate yourlocal.timeserver.host
If the above command failed, and you are more likely behind the firewall. This is how to update date and time behind the firewall
# ntpdate -u yourlocal.timeserver.host
Sync date and time using IP address is also possible like so
# ntpdate 216.194.70.2
SYNCING TIME LOCALLY USING RDATE
=======================================
Rdate linux command gets and update time via network.
Again, initially get your current date and time system values for comparison.
# date
To print current date and time values from local NTP server using rdate, this could be done like so:
# rdate -p local.NTP.IP.address
To sync date and time locally from your NTP server or from the network using rdate would be:
# rdate -s local.NTP.IP.address
To sync date and time locally using rdate via UDP instead of TCP as its transport, this could be done like so:
# rdate -u local.NTP.IP.address
SYNCING DATE/TIME PERMANENTLY AND AUTOMATICALLY USING NTP DAEMON
================================================================
How to sync date between or after reboot?
How to synchronize date and time automatically in linux?
How to install NTP daemon service in linux?
If your server has never been rebooted, there should be a lot of difference and time skipped by the server during high load processes. Because of this, unattended syncing of date and time is needed to be checked, monitored and synced automatically. This approach calls for making NTP act as a NTP daemon service.
How to install NTP daemon service to automatically check and update date/time values from NTP server?
NTP daemon can be installed by doing so:
# yum -y install ntp
With default installation, NTP daemon service could be started and run faily well as follows
# service ntpd start
NTP daemon service makes use of /etc/ntp.conf . Watch the date/time differences from the result of issuing date command and after starting NTP daemon service.
To check for NTP daemon service status would be
# service ntpd status
Making NTP daemon service permanent between reboots would normally be like so
# chkconfig --levels 35 ntpd on
Note:
3 represent runlevel 3, that is bootup to command line with no GUI and 5 represents with X.
Further ntp.conf customization would not be included here, I am going to create a separate entry for creating a NTP server out of Fedora box. Changing timezone via terminal would also not be covered and created here. They would be covered on a separate entry too sooner or later.
If you wish to sync your hardware clock from your system clock or vice versa, there is howto that can be easily viewed here.
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2007
(340)
-
▼
August
(95)
- KCron - GUI task scheduler
- Linux backups powered by Tar
- INQ7 front page image retrieval
- using wget for data and file transfers
- BibleTime - Bible study from Linux howto
- human readable DVD/CD drive technical details
- sound-juicer - alternative audio CD ripper install
- Stellarium - watch the sky from Linux
- Munin - monitor linux hosts install howto
- blocking yahoo chat messenger
- string manipulation using cut linux command
- graphing skystream DVB receiver's Eb/No and signal...
- BZFlag - 3D multi-player tank game install howto
- screenshot and snapshot creations howtos
- string parsing using bash
- grep multiple character from string or file
- enable and disable of telnet service
- grep multiple strings from a file
- remove spaces from filenames
- ISO creation and CD/DVD burning from terminal
- send a message to user's terminal
- retrieve GMail emails via terminal using fetchmail
- more of activating and deactivating network card
- set new mysql password
- TIP: enable thumbnail display images from apache
- monitor large mailbox users
- using the linux yes command
- string manipulation using tr linux command
- install and play 2D chess game in linux
- more firefox tips and tricks
- recover root password on linux
- establish ssh connection from different port
- uniq linux command
- remove blank lines using grep or sed
- date and time sync via NTP server howto
- who am I
- delete spam email and folder regularly howto
- hello world bash and perl script
- passwordless rdesktop session with XP howto
- force VGA screen resolution and screen mode
- RealPlayer 10 for linux install howto
- Grip - CD ripper install howto
- Banshee - music management and playback
- gnome music applet install howto
- Pirut and yum-updatesd - software management
- Alacarte - editing panel menus install howto
- access NTFS drive in Fedora
- FileLight - graphical disk usage and statistics
- TestDisk- partition tool install howto
- using /dev/null in linux terminal
- yahoo messenger in fedora install howto
- check and repair MS-DOS file systems howto
- using fdformat and mkdosfs from terminal
- Tremulous - Quake 3 install howto
- block consecutive IP address using scripts
- using floppy linux command from terminal
- display word or text file in reversed pattern
- convert a file to equivalent hex/binary code
- spell check text file from terminal
- create screen timer from linux howto
- recreate deleted /dev/null
- harddisk monitoring using smartctl
- bind ssh to selected IP address
- restrict su command to superuser only
- thunderbird install howto
- dovecot POP3/POP3S server with SSL/TLS install howto
- qpopper POP3 server install howto
- my other linux pages
- more ssh log parsing and monitoring
- checking daemon service bash script
- HTML CHM help file viewer install howto
- du - the disk usage linux command howto
- gnome language translator install howto
- display linux memory information howto
- display the number of processor howto
- 3d tabletennis game install howto
- Nokia N70 on Fedora via USB data cable
- Fedora 7 as guest host from VirtualBox
- at - jobs scheduling howto
- Nokia 70 linux connection via bluetooth dongle howto
- crontab - jobs scheduling howto
- managing daemon services howto
- create your own linux OS distro howto
- kernel devel headers install howto
- more multimedia browser plugins install howto
- numlock on with X install howto
- Fedora and RHEL differences
- create virtual terminals with single ssh connection
- virtual CentOS using VMWare 5.5.4 install howto
- VMware workstation 5.5.4 install howto
- 50 quick linux command tips part 4
- 5 SysAds permanent static route story
- ssh log parsing and monitoring
- removable drives, devices and media preferences
- gnome-blog desktop blogging install howto
-
▼
August
(95)
Tuesday, August 21, 2007
date and time sync via NTP server howto
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment