Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've just commissioned a new Debian 10 server. Two oddities which may be related (or not).
All my Debian 10 systems until now put date as follows:
# date
Thu 16 Jan 15:25:21 GMT 2020
The new system ouputs:
# date
Thu 16 Jan 2020 03:25:59 PM GMT
The other oddity is that cron jobs on new system execute an hour earlier than requested.
My first thought was 'locale' but both are identical:
# cat /etc/default/locale
# File generated by update-locale
LANG="en_US.UTF-8"
I checked the Time zone, again both identical:
timedatectl
Local time: Thu 2020-01-16 15:30:15 GMT
Universal time: Thu 2020-01-16 15:30:15 UTC
RTC time: Thu 2020-01-16 15:30:16
Time zone: Europe/London (GMT, +0000)
System clock synchronized: yes
NTP service: inactive
RTC in local TZ: no
Research here and elsewhere is how to display time in different formats but silent so far on how 'date' finds its default format which, as you can see differs.
Any chance of cheating?
have cron fire off echo $(date) > to a file, and see what time it thinks it is when it fires? Assuming that cron daemon has been restarted as well. What time is it showing in syslog/messages?
also is this a crontab, or a cron residing in /etc/cron.d/ ?
The cron offset is sorted. It had clearly not picked up the shift in timezone so a cron restart fixed it. Which leaves the more intriguing issue of the different date default formats. As a reminder:
user@A:~# date
Thu 16 Jan 18:28:24 GMT 2020
user@B:~# date
Thu 16 Jan 2020 06:30:17 PM GMT
That is 24hr v AM/PM and the position of the year. These are both brand new Debian 10 VPS from the same provider. All my other Debian 8/9/10 servers show system A format. So how does date determine it's default format and what could have screwed system B?
A free operating system for the first right answer
All sorted. A quick dpkg-reconfigure locales got it to stick.
I usually use that to make the server speak proper English - but yesterday used another method which would work if your American but not if you're British.
Well that's it. All cosmetic really but annoying when you have a new server humming nicely. Learning point is to put dpkg-reconfigure locales on my ToDo list instead of 'change language'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.