is changing time or date risky?

Nav444
Nav444 used Ask the Experts™
on
Hi
If I change the date or time on linux, which is running mailserver[postfix] and webserver[apache], will face any problem.
I do not want to restart the server at all.

Is this risky?

And if it is safe, how can I do it?

Nav
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2006
Commented:
Nope - it's not risky provided all software used is well behaved. Most linux system merely reports in the log files the new time in their next transaction nothing more - I can't see why you should have any problems either with what you've described.

You change the date and time using the...wait for it...date command. Use 'man date' for more info.

e.g:

date -s "Jan 10 00:01:45 GMT 2003"
will set the date - obviously check that date is in your path

the command:

date

by itself returns the current date.

Note that if you have an ntp(network time protocol) client or server running on your system, altering the time/date may have effects on times elsewhere.

Hope this helps:)
XoF

Commented:
perhaps one should underline the part _well behaved_ in the last posting!

I've experienced some trouble, when turning the clock _backwards_. Some software for example behaves quite weird when files have a creation time in the future.

Modifying system time by simply changing it is definetly _not recommended_. Better you use for example NTP, which adjusts your system time by increasing/decreasing the clock's speed.

If you really want to go the hardcore way, the command "hwclock" might be of interest for you, as it allows to also adjust the hardware clock.

HTH,

-XoF-
Agree with part change system date will cause quite some unexpected results. For one, ssh seesion will just hang on you! A restarting is highly recommented, or at least restart all the services.

But hwclock doen't really come in the picture, 99.9 of the software using date, not hwclock.

Basically there's two clock, one is date, which is software based, one is hwclock which is saved in BIOS. The access of hwclock is MUCH slower than date.

One can sync hwclock/date with "hwclock --systohc", and  "hwclock --hctosys", do "man hwclock" for more info.

Hwclock is only when you want to change the system date even after reboot. Most of the system will do the sync when shuting down anyway.
Nav444:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
XoF

Commented:
award points to pjedmond

regards,
-XoF-

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial