LinuxQuestions.org
Review your favorite Linux distribution.
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 04-20-2010, 07:49 AM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
How to tell how long last reboot took


Is there certain lines I could look through in a certain log file to give me a rough estimate of how long the last, or last couple, reboots of a server took?
 
Old 04-20-2010, 08:12 AM   #2
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
I'd say check out /var/log/messages and see and look for the time you think it was rebooted and go from there
 
Old 04-20-2010, 08:45 AM   #3
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Linux command w will show you the details

or

cat /proc/uptime
 
Old 04-20-2010, 09:05 AM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
^ I think he wants to know how long the actual reboot took.... Not how long the server has been up.
 
Old 04-20-2010, 09:08 AM   #5
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Correct, I want to know how long the server is down for while it reboots, on average, or at least the last time.

The problem is is that I dont know when the last time it was rebooted. Can i just grep for certain phrases, then subtract the time stamps to give me the time?
 
Old 04-20-2010, 09:59 AM   #6
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
I just looked on the server, its been up for almost 100 days, but my messages files only go back to March, and that ones only 15k :-(

Can anyone think of another way to figure this out?
 
Old 04-20-2010, 12:24 PM   #7
no2498
Member
 
Registered: Jan 2010
Posts: 120

Rep: Reputation: 23
? does it not start deleting cache files after it fills up
may be why your log is short

hope this helps
 
Old 04-20-2010, 12:28 PM   #8
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
yeah, it overwrites them as time goes by, not sure why they are so small though.
 
Old 04-20-2010, 07:18 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
The settings for the num of logfiles preserved is in the logrotate configs

logrotate.conf
logrotate.d
 
Old 04-20-2010, 07:32 PM   #10
elaguilas
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
is goood

is good
 
Old 04-21-2010, 05:25 AM   #11
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
it looks like i'm keeping 4 files, but i dont know why these ones are so small.
 
  


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 long has your Debian system been up without reboot? freddie_leaf Debian 13 02-04-2016 05:35 PM
Are kernel panics normal at reboot when servers been running for a long time? anon091 Linux - Newbie 36 10-12-2009 03:50 PM
screensaver froze, reboot ,3 long beeps, Fedora 11 never boots,no splash screen ehdwuld Linux - General 3 07-01-2009 06:00 PM
LXer: This week at LWN: Long discussions about long names LXer Syndicated Linux News 0 05-19-2009 10:50 PM
Reboot only after long wait Kroenecker Linux - Hardware 2 03-23-2004 07:02 AM

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

All times are GMT -5. The time now is 05:40 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