Tuesday, October 24, 2006

Manual clock synchronization

How to synchronize your Linux computer clock with ntp server in the Internet?

1. Make the Script file like this and call it ntpsync as example:
#!/bin/bash
#
clear

case "$1" in
go)
  echo "Starting NTP synchronization..."
  ntpdate ntp1.ptb.de && echo "OK ;)" || echo "failed :("
;;
*)
  echo "Usage: ntpsync {go}"
  exit 1
esac

exit $RETVAL

2. Then give such command as root
# ntpsync go
3. Give this as root also
# clock -w
This will setup your hardware clock

Enjoy

No comments: