Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Synchronizing system time

Posted on 2004-04-14
6
Medium Priority
?
208 Views
Last Modified: 2010-04-15
Hey guys,
I'm not sure if this is the right forum for this question.
I have a time server that I want a number of windows XP machines to synchronize with.  How can I configure them so that they try to synchronize at 3:00 am.  I don't want to set intervals as in "run every x number of hours".  I want them to sync at a specific time.  Is this possible?  Could this be done programmatically?

Thanks
0
Comment
Question by:fifo123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 22

Expert Comment

by:_TAD_
ID: 10825545


The best method would probably be to create a window's service on your "time machine"
 he he

This service would do three things:

1) Poll the time once every second (or two depending on how accurate you want to be).
2) At 2 AM, gather a list of all servers on the network (either by IP or by alias)
3) at 3 AM, log into each server and set the time to 3AM



As a control point, I would create a global flag isRunning which is set to false most of the time.  Then when the application is gathering data or updating servers then the flag will be set to true (so we don't duplicate processes).

I would probably also put the 3AM update into a seperate thread for each server.  So at 3AM your CPU on your time machine will jump to 60% or 80% (and network traffic will spike), but then at least then all computers will be updated at the same time.


Your other alternative (which we use at my job) is to have each computer at a scheduled time check the time server and then update its own time with whatever the time machine has.

We do this because of reboot and backup schedules.  if all of the machines were going to be updated at the same time, then we could not perform backups or reboots at 3AM.



0
 

Author Comment

by:fifo123
ID: 10825843
Hey TAD,
Thanks for the response.
In the implementation used at your job, how do you guys schedule each computer to check the time server at a specific time?  Do you have a custom application that does this?  If so, do you know of a sample I can take a look at anywhere?

I have been trying to edit the registry entry at:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient \

but I don't see anything that would allow me to set a schedule time.  It only allows intervals.

thanks for your help.
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 10828145


For servers that we re-boot on a weekly basis, we re-sync at boot up.  So we are not sync-ing at "3 AM", we are instead going out to the time server and grabing the current time and then setting the machine clock to that time.   This happens on a periodic rate for servers that stay on all the time (like domain servers), or else happens at reboot for production application servers.


As for code... I really think it is a simple DOS batch program that is executed at startup or is scheduled to execute by the Win NT/2000 scheduler.
0
 
LVL 22

Accepted Solution

by:
_TAD_ earned 200 total points
ID: 10828202


as for changing reginstry entries in DOS, the command is pretty simple.

To query your registry in DOS

reg query HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient

type the following for help
reg /?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question