Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am setting up a server with several VPS. I am using LXC. I am thinking it would be better to have only the main server equipped with ntp and have the virtual boxes just get the time from the main box. Is there a bash/python/php etc script I could use to get the time from the main server?

share|improve this question
    
Here is an idea. Set on the main server the hwclock, and have the VPSs pick that up. How does that sound? –  RoboTamer Dec 12 '11 at 8:17
    
Doing a bit more research. It seams I can run the /etc/init.d/hwclock.sh once in a while to set all clocks. when run with start it set the hardware clock, so this would be done on the main server where I have ntp running and the vps'es could run it with stop to set the system clock, again with a cron job every now and then. How does that sound? –  RoboTamer Dec 12 '11 at 8:38

1 Answer 1

Got no answer, so here is what I did, and I am wondering if there are any consequences to this that I should be aware of.

Main server cron job

* 0 *  * * /sbin/hwclock -w

Each VPS has following cron job

10 0 *  * * /sbin/hwclock -s

Thanks

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.