Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

adjust system time

SOLVED
Go to solution
lawrenzo
Trusted Contributor

adjust system time

Hello,

I am working on a system where ntp will not start and I believe it is due to the clock being out by 1.5 hrs ...

I have adjusted the time by speeding up the time on other unix systems however I cannot find an option to do this on tru64 ...

can some tell me how to speed up the clock until it reaches the desired time?

thanks

Chris.
hello
7 REPLIES
Ivan Ferreira
Honored Contributor
Solution

Re: adjust system time

Do you want to adjust the time slowly?

You have the option to use ntpdate, probably your best option.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
lawrenzo
Trusted Contributor

Re: adjust system time

also after doing some more reading I found out that where my ntp.conf file has a server entry pointing to 127.127.1.0 which is specifying its own internal clock

I presume that the clock is out of sync - how can I bring this back in line,

on other O/S i can run

# date -a +/-
how can I perform this on my tru64 box?

Thanks

Chris
hello
lawrenzo
Trusted Contributor

Re: adjust system time

Hi yes I could do with it adjusting slowly rather than running date
hello
lawrenzo
Trusted Contributor

Re: adjust system time

how can I get the system to slowly catch up with the ntpdate command

I have read the man page and am not sure if I run the command the clock will just bring the system to the current time?

Thanks

Chris
hello
Ivan Ferreira
Honored Contributor

Re: adjust system time

With ntpdate is not possible, so I created a shell script to increase your clock by the number of specified seconds:

if [ $# -eq 0 ]
then
echo "Usage $0 "
else
INCR=$1
THIS_SECOND=`date +%S`
STEP=`expr $THIS_SECOND + $INCR`
date +"%m%d%H%M.%S"
if [ $STEP -lt 10 ]
then
date `date +"%m%d%H%M.0$STEP"`
else
date `date +"%m%d%H%M.$STEP"`
fi
fi


Some examples of usage:

adjust_time 2

while true
do
adjust_time 1
done
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rob Leadbeater
Honored Contributor

Re: adjust system time

Hi Chris,

The man pages for xntpd suggests that you should be able to use the -g option to allow corrections of more than 1000 seconds...

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN8/0308____.HTM

As previously mentioned, you won't be able to use ntpdate as that changes the time immediately.

Hope this helps,

Regards,

Rob
Mark Poeschl_2
Honored Contributor

Re: adjust system time

You never really say, but do you have an external NTP server with an accurate time source to point NTP to? The 127.127.1.0 entry in your ntp.conf suggests possibly not. If you can't get to an external NTP server you'll probably be right back in the same boat in a few weeks or months.