PDA

View Full Version : Auto-Sync System Time


zerodot02
2004-07-26, 09:33 AM
I'm using a paypemnt gateway system that is time-locked, requiring my server time to be within a few minutes of another system time. What I'm having to do now is to sync it manually every day by typing in their server name and using the sync feature (in webmin).

How could I automate this process? Put in some kind of cron job? If so, how?

Thanks for any help.

Tino Didriksen
2004-07-26, 10:21 AM
You can put this as your /etc/cron.daily/ntpdate :
#!/bin/sh
ntpdate -u -b timeserver.example.com 2>/dev/null >/dev/null
hwclock --systohc

zerodot02
2004-07-27, 19:19 PM
Thanks!

But, I get this when I try to run it:

./ntpdate: hwclock: command not found

Any ideas?

zerodot02
2004-07-27, 19:26 PM
Nevermind, I used /sbin/hwclock instead of just hwclock and that worked.

Thanks again!