Last Reboot commands don't agree












4















Different commands about showing last reboot have different opinions. Who is right?



# uptime
10:05:31 up 90 days, 12:59, 2 users, load average: 0.04, 0.02, 0.00

# who -b
system boot 2018-11-22 21:05
# last reboot

wtmp begins Sat Feb 2 01:59:42 2019









share|improve this question



























    4















    Different commands about showing last reboot have different opinions. Who is right?



    # uptime
    10:05:31 up 90 days, 12:59, 2 users, load average: 0.04, 0.02, 0.00

    # who -b
    system boot 2018-11-22 21:05
    # last reboot

    wtmp begins Sat Feb 2 01:59:42 2019









    share|improve this question

























      4












      4








      4








      Different commands about showing last reboot have different opinions. Who is right?



      # uptime
      10:05:31 up 90 days, 12:59, 2 users, load average: 0.04, 0.02, 0.00

      # who -b
      system boot 2018-11-22 21:05
      # last reboot

      wtmp begins Sat Feb 2 01:59:42 2019









      share|improve this question














      Different commands about showing last reboot have different opinions. Who is right?



      # uptime
      10:05:31 up 90 days, 12:59, 2 users, load average: 0.04, 0.02, 0.00

      # who -b
      system boot 2018-11-22 21:05
      # last reboot

      wtmp begins Sat Feb 2 01:59:42 2019






      reboot






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 21 at 9:35









      DimiDakDimiDak

      1213




      1213






















          2 Answers
          2






          active

          oldest

          votes


















          9














          They are all correct.





          • uptime shows that the system has been up for 90 days and some
            hours.


          • who -b says the system was booted 2018-11-22 21:05 .. 90
            days and some hours ago.


          • last reboot says that the wtmp log file was rolled over or trunctaded at Sat Feb 2 01:59:42 2019, so it don't contain a reboot record.






          share|improve this answer
























          • Thanx, I didn't get the last one though..

            – DimiDak
            Feb 21 at 11:44






          • 1





            It is explaining that wtmp does not reach all the way back to the last boot.

            – Chris Stratton
            Feb 21 at 21:43



















          6














          The uptime command is telling you the current time, followed by the length of time the system has been running. In your example this shows the system has been up for 90 days, 12 hours and 59 minutes.



          who -b is giving you a date and time that corresponds to the same boot time. There's only a difference of seconds there, which I presume is the time taken between commands.



          The last reboot command uses the /var/log/wtmp file to determine the last boot. This log file has been rotated since the last boot took place, so does not contain information about the last boot. There is likely an old version of wtmp, such as /var/log/wtmp.1 that you can also query with:



          last reboot -f /var/log/wtmp.1


          Unfortunately it's unlikely that will contain details of your last reboot either due to the time frame.






          share|improve this answer
























          • Thanx, so what is "last reboot" good to use for?

            – DimiDak
            Feb 21 at 11:45








          • 3





            It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

            – Arronical
            Feb 21 at 11:49











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120063%2flast-reboot-commands-dont-agree%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          9














          They are all correct.





          • uptime shows that the system has been up for 90 days and some
            hours.


          • who -b says the system was booted 2018-11-22 21:05 .. 90
            days and some hours ago.


          • last reboot says that the wtmp log file was rolled over or trunctaded at Sat Feb 2 01:59:42 2019, so it don't contain a reboot record.






          share|improve this answer
























          • Thanx, I didn't get the last one though..

            – DimiDak
            Feb 21 at 11:44






          • 1





            It is explaining that wtmp does not reach all the way back to the last boot.

            – Chris Stratton
            Feb 21 at 21:43
















          9














          They are all correct.





          • uptime shows that the system has been up for 90 days and some
            hours.


          • who -b says the system was booted 2018-11-22 21:05 .. 90
            days and some hours ago.


          • last reboot says that the wtmp log file was rolled over or trunctaded at Sat Feb 2 01:59:42 2019, so it don't contain a reboot record.






          share|improve this answer
























          • Thanx, I didn't get the last one though..

            – DimiDak
            Feb 21 at 11:44






          • 1





            It is explaining that wtmp does not reach all the way back to the last boot.

            – Chris Stratton
            Feb 21 at 21:43














          9












          9








          9







          They are all correct.





          • uptime shows that the system has been up for 90 days and some
            hours.


          • who -b says the system was booted 2018-11-22 21:05 .. 90
            days and some hours ago.


          • last reboot says that the wtmp log file was rolled over or trunctaded at Sat Feb 2 01:59:42 2019, so it don't contain a reboot record.






          share|improve this answer













          They are all correct.





          • uptime shows that the system has been up for 90 days and some
            hours.


          • who -b says the system was booted 2018-11-22 21:05 .. 90
            days and some hours ago.


          • last reboot says that the wtmp log file was rolled over or trunctaded at Sat Feb 2 01:59:42 2019, so it don't contain a reboot record.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 21 at 9:44









          Soren ASoren A

          3,4781924




          3,4781924













          • Thanx, I didn't get the last one though..

            – DimiDak
            Feb 21 at 11:44






          • 1





            It is explaining that wtmp does not reach all the way back to the last boot.

            – Chris Stratton
            Feb 21 at 21:43



















          • Thanx, I didn't get the last one though..

            – DimiDak
            Feb 21 at 11:44






          • 1





            It is explaining that wtmp does not reach all the way back to the last boot.

            – Chris Stratton
            Feb 21 at 21:43

















          Thanx, I didn't get the last one though..

          – DimiDak
          Feb 21 at 11:44





          Thanx, I didn't get the last one though..

          – DimiDak
          Feb 21 at 11:44




          1




          1





          It is explaining that wtmp does not reach all the way back to the last boot.

          – Chris Stratton
          Feb 21 at 21:43





          It is explaining that wtmp does not reach all the way back to the last boot.

          – Chris Stratton
          Feb 21 at 21:43













          6














          The uptime command is telling you the current time, followed by the length of time the system has been running. In your example this shows the system has been up for 90 days, 12 hours and 59 minutes.



          who -b is giving you a date and time that corresponds to the same boot time. There's only a difference of seconds there, which I presume is the time taken between commands.



          The last reboot command uses the /var/log/wtmp file to determine the last boot. This log file has been rotated since the last boot took place, so does not contain information about the last boot. There is likely an old version of wtmp, such as /var/log/wtmp.1 that you can also query with:



          last reboot -f /var/log/wtmp.1


          Unfortunately it's unlikely that will contain details of your last reboot either due to the time frame.






          share|improve this answer
























          • Thanx, so what is "last reboot" good to use for?

            – DimiDak
            Feb 21 at 11:45








          • 3





            It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

            – Arronical
            Feb 21 at 11:49
















          6














          The uptime command is telling you the current time, followed by the length of time the system has been running. In your example this shows the system has been up for 90 days, 12 hours and 59 minutes.



          who -b is giving you a date and time that corresponds to the same boot time. There's only a difference of seconds there, which I presume is the time taken between commands.



          The last reboot command uses the /var/log/wtmp file to determine the last boot. This log file has been rotated since the last boot took place, so does not contain information about the last boot. There is likely an old version of wtmp, such as /var/log/wtmp.1 that you can also query with:



          last reboot -f /var/log/wtmp.1


          Unfortunately it's unlikely that will contain details of your last reboot either due to the time frame.






          share|improve this answer
























          • Thanx, so what is "last reboot" good to use for?

            – DimiDak
            Feb 21 at 11:45








          • 3





            It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

            – Arronical
            Feb 21 at 11:49














          6












          6








          6







          The uptime command is telling you the current time, followed by the length of time the system has been running. In your example this shows the system has been up for 90 days, 12 hours and 59 minutes.



          who -b is giving you a date and time that corresponds to the same boot time. There's only a difference of seconds there, which I presume is the time taken between commands.



          The last reboot command uses the /var/log/wtmp file to determine the last boot. This log file has been rotated since the last boot took place, so does not contain information about the last boot. There is likely an old version of wtmp, such as /var/log/wtmp.1 that you can also query with:



          last reboot -f /var/log/wtmp.1


          Unfortunately it's unlikely that will contain details of your last reboot either due to the time frame.






          share|improve this answer













          The uptime command is telling you the current time, followed by the length of time the system has been running. In your example this shows the system has been up for 90 days, 12 hours and 59 minutes.



          who -b is giving you a date and time that corresponds to the same boot time. There's only a difference of seconds there, which I presume is the time taken between commands.



          The last reboot command uses the /var/log/wtmp file to determine the last boot. This log file has been rotated since the last boot took place, so does not contain information about the last boot. There is likely an old version of wtmp, such as /var/log/wtmp.1 that you can also query with:



          last reboot -f /var/log/wtmp.1


          Unfortunately it's unlikely that will contain details of your last reboot either due to the time frame.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 21 at 9:45









          ArronicalArronical

          13.6k84892




          13.6k84892













          • Thanx, so what is "last reboot" good to use for?

            – DimiDak
            Feb 21 at 11:45








          • 3





            It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

            – Arronical
            Feb 21 at 11:49



















          • Thanx, so what is "last reboot" good to use for?

            – DimiDak
            Feb 21 at 11:45








          • 3





            It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

            – Arronical
            Feb 21 at 11:49

















          Thanx, so what is "last reboot" good to use for?

          – DimiDak
          Feb 21 at 11:45







          Thanx, so what is "last reboot" good to use for?

          – DimiDak
          Feb 21 at 11:45






          3




          3





          It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

          – Arronical
          Feb 21 at 11:49





          It can tell you what the last reboot was, but it has to be recent enough that it's still available in the recent versions of the wtmp file. There must be a way to reconfigure how many wtmp files are saved. If you reboot your server now, then issue last reboot, it will show up in the output. The current output just means there are no recorded reboots in wtmp.

          – Arronical
          Feb 21 at 11:49


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120063%2flast-reboot-commands-dont-agree%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?