Ubuntu server wrong boot/reboot timestamps

Ubuntu Version:
24.04

I found by chance that the server report wrong timestamps of boots and reboots

running the command

# last
user1      pts/0        ip addr       Wed Mar  4 21:39   still logged in
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07   still running
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07   still running
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07 - 02:00 (78+03:52)
user1      pts/0        ip addr       Thu Feb 26 20:59 - 21:00  (00:00)
user1      pts/0        ip addr       Wed Feb 25 00:58 - 01:09  (00:11)
user1      pts/0        ip addr       Wed Feb 25 00:56 - 00:58  (00:01)
user1      pts/0        ip addr       Wed Feb 25 00:38 - 00:56  (00:18)
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07 - 02:00 (77+03:52)
user1      pts/0        ip addr       Wed Feb 25 00:37 - 00:37  (00:00)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 00:37 (74+02:30)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 00:37 (74+02:30)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 00:37 (74+02:30)
user1      pts/0        ip addr       Fri Feb 20 20:12 - 20:25  (00:13)
user1      pts/0        ip addr     Wed Feb 18 10:42 - 14:30  (03:48)
user1      pts/0        ip addr       Sun Feb 15 16:02 - 16:05  (00:03)
user1      pts/0        ip addr       Sat Feb 14 10:47 - 12:23  (01:36)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 02:00 (70+03:52)
user1      pts/0        ip addr       Tue Feb 10 20:42 - 20:45  (00:03)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 02:00 (63+03:52)
user1      pts/0        ip addr       Tue Feb 10 17:55 - 20:35  (02:39)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 20:35 (59+22:27)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 20:35 (59+22:27)
user1      pts/0        ip addr       Tue Feb  3 21:58 - 21:59  (00:00)
user1      pts/0        ip addr       Tue Feb  3 19:21 - 20:37  (01:16)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (56+03:52)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (56+03:52)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (56+03:53)
user1      pts/0        ip addr       Sat Jan 31 22:47 - 22:48  (00:00)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (50+03:52)
user1      pts/0        ip addr       Sat Jan 31 22:29 - 22:37  (00:07)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 22:37 (50+00:30)
user1      pts/1        ip addr     Tue Jan 27 13:45 - 13:46  (00:01)
user1      pts/1        ip addr     Tue Jan 27 13:27 - 13:45  (00:18)
user1      pts/0        ip addr     Tue Jan 27 12:18 - 16:18  (04:00)

The user1 connections are my connections via ssh and the ubu-server has
a cron job that reboot every n days
But everytime it reboots, as you can see, it reports as timestamp

Fri Dec 12 22:07

The current date is correct and in the output above the user1 ssh logins
report the correct timestamp

With the command last boot timestamps show for every reboot happened every
n days always the same timestamp

# last reboot
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07   still running
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07   still running
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07 - 02:00 (78+03:52)
reboot   system boot  6.8.0-1048-ubu-server Fri Dec 12 22:07 - 02:00 (77+03:52)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 00:37 (74+02:30)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 00:37 (74+02:30)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 00:37 (74+02:30)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 02:00 (70+03:52)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 02:00 (63+03:52)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 20:35 (59+22:27)
reboot   system boot  6.8.0-1047-ubu-server Fri Dec 12 22:07 - 20:35 (59+22:27)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (56+03:52)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (56+03:52)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (56+03:53)
reboot   system boot  6.8.0-1045-ubu-server Fri Dec 12 22:07 - 02:00 (50+03:52)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 22:37 (50+00:30)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 02:00 (46+03:53)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 02:00 (46+03:53)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 02:00 (36+03:53)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 02:00 (36+03:53)
reboot   system boot  6.8.0-1044-ubu-server Fri Dec 12 22:07 - 21:12 (31+23:05)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:07 - 21:51 (28+23:44)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:07 - 02:00 (26+03:53)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:06 - 12:54 (19+14:47)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:06 - 13:28 (8+15:21)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:06 - 12:26 (5+14:19)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:06 - 23:49 (5+01:43)
reboot   system boot  6.8.0-1043-ubu-server Fri Dec 12 22:06 - 11:53 (4+13:46)
reboot   system boot  6.8.0-1042-ubu-server Fri Dec 12 22:06 - 07:56 (4+09:49)
reboot   system boot  6.8.0-1042-ubu-server Fri Dec 12 22:06 - 16:45 (1+18:38)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 19:34 (129+00:34)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 19:34 (129+00:34)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 19:34 (129+00:34)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 01:02 (126+06:02)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 16:58 (125+21:58)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 15:36 (125+20:37)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 01:47 (125+06:47)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:59 - 01:34 (125+06:35)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 01:27 (125+06:28)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 01:25 (125+06:26)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 01:24 (125+06:25)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 00:33 (125+05:34)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 00:21 (125+05:22)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 00:18 (125+05:19)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 00:11 (125+05:12)
reboot   system boot  6.8.0-1042-ubu-server Tue Aug  5 19:58 - 00:02 (125+05:04)
reboot   system boot  6.8.0-1031-ubu-server Tue Aug  5 19:58 - 19:52 (125+00:54)

Any clue ?

What does this give you

last -x -F reboot

I think it is supposed to show 2 entries for each. The first date/time on the line represents the boot date/time, and the second date/time to the right of that represents when the system was shutdown. Still running means the current boot session still live, it hasn’t been shutdown yet. I’m on a VM right now which get a lot of restarts, so my log is full of entries with the same date. Last is a little tricky to follow what’s going on. Oh BTW you may also be on UTC time, like I am so my system timestamps are not my actual local time.

https://manpages.org/last

How about

journalctl --list-boots

Are you using NTP to set the system date and time? Is this a dual boot system?

Just my guess: time of reboots is logged (or shown) relative to specific dates (events) (Aug 5, Dec 12, …)
There are about 129 days from 5th August to 12th December …

1 Like

@aljames last -x -F reboot very useful command :+1:

The issue is that the raspberry-pi 4 does not have battery, so it does not log the boots/reboots timestamps

This seems to be wrong. RPi used without RTC explains why the boot times are logged relative to events but the boot times are logged! See your posted logs and explanation in post #4.

1 Like

The

19:34 (129+00:34)

is the shutdown time not the boot time

The boot time is not available for the reason I wrote before

As far as I know RPi without RTC shuts down saving the system time. On (re-)start it just resumes at this saved time. Therefore shutdown time and (re-)boot time do not differ. And after restart your system seems to get actual time from a time server.

1 Like

Shutdown is registered boot is not. Have a good day.