timdatectl command
Hello,
I have a question in regard to timedateclt. I have a server that is picking up GMT/UTC time and is five hours off as I am here in New York.
If I run the command timedatectl set-timetimezone America/New_York it will change the time to EST. However, I am wondering what will happen to the files and folders on the Server? I think that is the only command I need to run.
Will they retain the UTC/GMT time or will they inherit the new EST time. I am thinking its the latter in that files/folders will inherit new times.
More important though is what will happen to timestamps of backups, specifically my databases backups?
I could not really find a clear answer on the Internet so reason why I am posting here.
As always all help is greatly appreciated.
Regards,
Patrick Broderick
Responses
The command is timedatectl and not timedateclt (https://access.redhat.com/solutions/1449713).
The access/modify/change dates of files and directories are registered in UTC in their inode. Retrieving these dates takes the timezone into consideration. When I changed from Europe/Amsterdam into Asia/Taipei the time of a directory changed from 10:17 to 17.17. The stat command displays the date and time and timezone offset for a file/directory.
When your (backup)scripting uses the date command to generate filenames, there will be a gap or overlap in filenames when you change the timezone "west" or "east". Specifics for your database backups depend upon the software you are using for the backups and its configuration.
[edited]
Patrick,
I can't remember where I read it, but I believe in modern file systems, the time info is stored in in UTC, and certainly within the inode, and the tzdata set on your system "translates" it to that computer's settings. Here's an experiment you can do to test this...
Make simple text file on your local system date >/tmp/boston_time.txt (let's say it's in Boston), and scp the file to (let's say your "London" system). Examine the time date stamp of the file on your London system after you perform a successful scp to your London system. Examine both the contents with the cat command, and the time date stamp of the file itself with ls -l.
Repeat the process from your London system date > /tmp/london_time.txt , scp it to your Boston system, and examine the time date stamp with ls -l /tmp/london_time.txt Note the ls -l against the same file on both systems that exist in different time zones.
This has to do with tzdata, and your system's local settings (if I'm wrong here, someone chime in please).
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
