4

I'm running an extremely typical CentOS 6.5 server at DigitalOcean. As part of the site setup, I've changed /etc/localtime to something appropriate for me:

rm /etc/localtime
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

This works fine, except somebody/something is resetting it: I'll check back in with the server at some random (I think) point, and find that my link has been replaced with the original localtime file, putting the server back in UTC. I've looked in /etc/cron* on the chance that there's a script in there doing it, but I can't find anything. Has anyone else run into this before? Thanks!

Jim Miller
  • 713
  • 2
  • 11
  • 23
  • Not quite a duplicate of that question, although it is related. This question is in regards to "What is resetting /etc/localtime automatically?", which is a different topic then "Changing Timezone, Centos Apache server". – Stefan Lasiewski Apr 09 '14 at 15:43
  • @StefanLasiewski That is also answered in that question. – Jenny D Apr 10 '14 at 08:20
  • 1
    This may be a duplicate, but it's the top result in google for "yum-cron update changed timezone" – lwitzel Aug 07 '15 at 18:32

1 Answers1

9

In order to (correctly) change the timezone of your system you will need to access the file /etc/sysconfig/clock and edit ZONE=<filename> value, for example

ZONE="Europe/Belgrade"

Then proceed with linking the zoneinfo file to /etc/localtime

ln -sf /usr/share/zoneinfo/Europe/Belgrade /etc/localtime

(if the question is what is resetting timezone info, it might be yum update)

Dusan Bajic
  • 2,046
  • 1
  • 17
  • 20