- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Sync system time
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2010 06:36 PM
тАО12-30-2010 06:36 PM
Sync system time
Now Server A is sync. with koeran country authory so its time should be correct . I am thinking is it a good way to set a schedule job in server B to get the time from server A , then run a scrpt ( in server B ) to set -9 hours for example , after server B get the time from server A , the current time is 10:00am , then run a script ( in server B ) to set -9 hours , the time will be changed to 01:00am , can advise is it a good way ? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2010 08:05 PM
тАО12-30-2010 08:05 PM
Re: Sync system time
standard, using the same method, as you use
for Server A? A system does not need to be
in the same time zone as its time standard
source.
I assume that you're using something like NTP
to control the time on Server A. If you said
what you really are doing, then it might be
easier to make useful suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2010 01:27 AM
тАО12-31-2010 01:27 AM
Re: Sync system time
(I assume this is for Korea?)
What does "date -u; date" show for both? They both should show the same time for UTC.
As Steven mentions, you should use NTP to synchronize the UTC times and then export TZ to the correct timezones.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2010 02:42 AM
тАО12-31-2010 02:42 AM
Re: Sync system time
Setting the clock backwards (e.g. from 10:00 AM to 01:00 AM) while applications are running is not recommended: it might cause incorrect timestamps to be recorded in databases and logs.
If those timestamps are subject to further processing, it might cause wrong results: for example, in a server that creates billing information for phone calls, setting the clock backwards 9 hours might cause the system to record the duration of a 15-minute call as "minus 8 hours 45 minutes". This might cause a negative amount to be billed, which might be embarrassing to the company.
All Unix systems should have their timezone settings set correctly. This will allow the systems to make correct timezone conversions whenever required.
In fact, the standard Unix system clock always runs in GMT/UTC time: if the system is set to use a local timezone, it only means all time information entered by the user is converted to UTC for processing and internal storage, and back to local timezone for output.
If you need to synchronize the clocks of your servers using local time information and the server is using some different timezone by default, you'll only need to specify the appropriate timezone when setting the time.
For example, on exactly 10:00 AM on 2011-Jan-2, you might run this command on server B, _even if server B is set to use GMT by default_:
TZ=KST-9 date 010210002011
The "date" command will check the TZ variable (like all HP-UX programs) and will understand that the new time value is specified using Korean timezone. The command will then automatically convert the time to GMT/UTC timezone before setting the system clock.
If you use time synchronization tools "ntpdate" or "xntpd", you should be aware that the NTP time synchronization protocol will only ever transmit time information in GMT/UTC time. The synchronization tools are designed to be aware of this, and will automatically do the right thing.
If your timezone settings are correct, you'll automatically get the right results: the systems set to Korean timezone the clock will display the correct Korean time, and the systems set to GMT will display the correct GMT time.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2010 07:17 AM
тАО12-31-2010 07:17 AM
Re: Sync system time
ntp is the answer you're looking for. "man xntpd" on hpux and google ntpd for some freely available time sync masters.
ntp is incredibly easy to set up. Once done, all your systems will be synced to the second - and displaying their times in the local timezone (through /etc/TIMEZONE file)
HTH;
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html