Results 1 to 5 of 5

Thread: How to list machine startup times

  1. #1
    Join Date
    Aug 2009
    Location
    Slovenia
    Beans
    91
    Distro
    Edubuntu 11.04 Natty Narwhal

    How to list machine startup times

    Hi everyone.

    I wonder if it is possible to list let's say last 10 machine startup dates and times somehow, are there any kernel logs which I could parse to get them? Any advice welcome, thanks

  2. #2
    Join Date
    Dec 2007
    Location
    Gainesville, Florida
    Beans
    Hidden!
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: How to list machine startup times

    the command 'last' will show you a list of last logged in users,
    'last reboot' will give you the reboot times. I only get two when I use that command. I don't know how to get any more than that.

    'last' parses the file /var/log/wtmp. There may be a /var/log/wtmp.1 which should be older and may have more boot times in it.

    Aha! 'last reboot -f /var/log/wtmp.1' on my system shows the last 15 reboots!
    Last edited by pbrane; October 9th, 2012 at 09:48 PM.

  3. #3
    Join Date
    Feb 2010
    Location
    WI USA
    Beans
    10,091
    Distro
    Ubuntu Development Release

    Re: How to list machine startup times

    Here are some related "last" commands. http://www.cyberciti.biz/tips/linux-...d-logfile.html
    Infinite diversity in infinite combination.

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Manual

  4. #4
    Join Date
    Aug 2009
    Location
    Slovenia
    Beans
    91
    Distro
    Edubuntu 11.04 Natty Narwhal

    Re: How to list machine startup times

    it is not actually about startups, but is still very useful, thanks
    Last edited by arcull; October 10th, 2012 at 05:48 AM.

  5. #5
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to list machine startup times

    Quote Originally Posted by arcull View Post
    Hi everyone.

    I wonder if it is possible to list let's say last 10 machine startup dates and times somehow, are there any kernel logs which I could parse to get them? Any advice welcome, thanks
    The syslog file has all startups in the file before it is rotated, or you can simply write a script that runs in /etc/rc.local to record each startup.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •