4

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
  • No ideea in solaris, but in general uptime is given by the kernel via some mechanism (like /proc/uptime) and last looks at /var/log/wtmp file or similar – Dan Dec 14 '15 at 16:29
5

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 the last information at the time the system was initially backuped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.