LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2018, 07:03 PM   #16
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888

Quote:
Originally Posted by scasey View Post
I've highlighted the last two boots of the server.
Is that not what you're asking?
On _my_ system
Code:
$ last reboot
will give them without other info and
Code:
$ uptime
will tell you how long you've been up since the last reboot.

As I cleanup the last database (/var/log/lastlog) every month, last will only give me the info from this month, but your lastlog may go back further.
 
1 members found this post helpful.
Old 12-28-2018, 07:29 PM   #17
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by ehartman View Post
On _my_ system
Code:
$ last reboot
will give them without other info and
Code:
$ uptime
will tell you how long you've been up since the last reboot.
Very cool! Thank you! That definitely looks like the answer to the OP's question!
Quote:
Originally Posted by ehartman View Post
As I cleanup the last database (/var/log/lastlog) every month, last will only give me the info from this month, but your lastlog may go back further.
Mine goes back to Tue Sep 19 16:24:49 2017, which is when I brought this server on-line.
 
Old 12-29-2018, 04:03 PM   #18
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by pan64 View Post
see post #2. Did you try the command last ?
While 'last' does show me the date-time of the most recent boot, and since I can use that date-time to search any log for entries around that time, I am looking for a log file entry that is definitive "system boot starts here".

Thank you for your replies,
~~~ 0;-Dan
 
Old 12-29-2018, 04:08 PM   #19
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by SaintDanBert View Post
While 'last' does show me the date-time of the most recent boot, and since I can use that date-time to search any log for entries around that time, I am looking for a log file entry that is definitive "system boot starts here".

Thank you for your replies,
~~~ 0;-Dan
What you see from the last command is the ‘definitive "system boot starts here".’
 
Old 12-29-2018, 07:34 PM   #20
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by SaintDanBert View Post
I am looking for a log file entry that is definitive "system boot starts here".
There isn't one because just after system boot logging is still disabled and the root fs mounted read-only.
As every distro has different startup handling the first entry AFTER the reboot is the one that came in just after system logging was enabled, the messages between the end of dmesg (which are in kernel memory, not disk) and that point never are logged (onto disk files).
So the first entry is distribution, kernel and startup method dependent.
Even the message in lastlog isn't WRITTEN on disk until the root fs has been remounted read-write. so after the file system check etc was done before that.
So by looking in the logs to lines after the date/time reported by last reboot you can determine what on YOUR system is the first logged entry.
 
1 members found this post helpful.
Old 12-30-2018, 03:01 AM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
the first message in /var/log/messages (this is my debian) is:
Code:
<date> <time> <host> kernel: [    0.000000] Linux version 4.9.0-8-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP Debian 4.9.130-2 (2018-10-27)
but as it was mentioned it depends on the distro and probably even the file /var/log/messages is missing.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file LittleMaster Linux - Server 0 09-04-2018 03:45 PM
[SOLVED] Won't boot: /etc/rc.d/init.d/rc: line 193: /var/log/boot.log: Read-only file system liquidkaleidoscopes Linux From Scratch 6 11-11-2011 08:53 PM
Multi-disk, multi-boot system does not boot after fresh install anth0ny5 Linux - Software 8 08-17-2011 02:02 AM
[SOLVED] /var/log/boot.log is empty in RHEL5.5. How to enable the boot log? rajivdp Linux - Newbie 1 08-12-2010 08:11 AM
fresh install (fresh headache) powadha Slackware 2 03-06-2004 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration