I'm asking because I recently restored a system from a backup using NetBackup and uptime now reports that the system has only been up since the restore finished, despite the fact that it has been running for several days. Last reboot
also reports the wrong information, but it but goes the other way, saying the last reboot was several months ago, when the system has been rebooted many times since then.
Essentially I want to know where the uptime and reboot info is stored so that I can maintain it across a restore in the future.
> uptime
9:54am up 1 day(s), 15:52, 3 users, load average: 0.93, 0.95, 0.86
> last reboot
wtmp begins Mon Sep 21 03:10
uptime
gets its information from a date stored in memory when the system boots.After a system restore the kernel starts with new information.
However the
last
information comes from a file, e.g./var/log/wtmp
, and was recovered with the restore, revealing thelast
information at the time the system was initially backuped.