Skip site navigation (1) Skip section navigation (2)

Re: How do I set the system time on production server?

From: "Andrew G(dot) Hammond" <drew(at)xyzzy(dot)dhs(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Ken Corey <ken(dot)corey(at)atomic-interactive(dot)com>,pgsql-sql(at)postgresql(dot)org
Subject: Re: How do I set the system time on production server?
Date: 2002-03-20 23:23:34
Message-ID: 20020320232334.GA650@xyzzy.dhs.org (view raw or flat)
Thread:
Lists: pgsql-sql
On Wed, Mar 20, 2002 at 12:22:13PM -0500, Peter Eisentraut wrote:
> Ken Corey writes:
> 
> > I've just realized that our (production, naturally) database's idea of the
> > current date/time is 24 hours and 14 minutes fast.  What a weird thing.
> >
> > So, is there a way to set the date/time?
> 
> The system time is inherited from the operating system.  You can use
> date(1) or maybe hwclock(8) to alter the system time.  On some systems it
> is not recommended to change the system time because that messes up all
> kinds of scheduling, so if you can afford it, reboot and change the time
> in the BIOS.  You should find information in those man pages about the
> recommended way to do it on your system.

A previous email mentioned ntp.  Personally, I'd use the 
above approach and then maintain the clock with ntpdate.  
This program references and ntp time server and gently 
syncs your system clock to the one true time.  I prefer 
this to running the ntp daemon propper, since that 
strikes me as overkill on most systems, and it adds yet 
another security issue to pay attention to.  Stick it as 
a cron job every couple of hours or so and it'll keep 
your clock in line.  Like all things ntp, you have to 
set your system clock to GMT, but that shouldn't be a 
problem unless you're running a braindead OS.  Anyway, 
for a time gap as big as the one you mentioned, there's 
probably no way to really fix it gently.

-- 
Andrew G. Hammond  mailto:drew(at)xyzzy(dot)dhs(dot)org  http://xyzzy.dhs.org/~drew/
56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F              613-389-5481 
5CD3 62B0 254B DEB1 86E0  8959 093E F70A B457 84B1
"To blow recursion you must first blow recur" -- me

In response to

pgsql-sql by date

Next:From: Keith GrayDate: 2002-03-20 23:41:30
Subject: Migrating a MySQL schema with an enum
Previous:From: Mike BiamonteDate: 2002-03-20 22:44:16
Subject: delete -> copy in -> WAL problem..?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group