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!

3
  • 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". Commented Apr 9, 2014 at 15:43
  • @StefanLasiewski That is also answered in that question.
    – Jenny D
    Commented Apr 10, 2014 at 8:20
  • 1
    This may be a duplicate, but it's the top result in google for "yum-cron update changed timezone"
    – lwitzel
    Commented Aug 7, 2015 at 18:32

1 Answer 1

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)

3
  • Looks very promising -- I've made the change and will see what happens in the next couple of days (translation: I'll come back in a couple of days and accept the answer if all's well). Thanks!
    – Jim Miller
    Commented Apr 9, 2014 at 18:59
  • Was this the correct answer? Commented Apr 22, 2015 at 13:59
  • This solved my issue where yum-cron update reset the time zone to UTC.
    – lwitzel
    Commented Aug 7, 2015 at 18:37

Not the answer you're looking for? Browse other questions tagged .