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?
Asked
Active
Viewed 1,206 times
2
-
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 08: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 08:38
1 Answers
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

RoboTamer
- 502
- 1
- 4
- 17