Board index Linux FAQ's

Moderator: chandranjoy

How to find out the server reboot/shutdown count?

Postby chandranjoy » Fri May 07, 2010 4:34 am

last | grep -i "^reboot" | wc -l

This command will show only the count of the server reboots (but this will
not include the server shutdown)
Ex:
last | grep -i "^reboot"|wc -l
2

last | grep -i "^reboot"

reboot system boot 2.6.18-128.1.10. Sun May 31 20:10 (00:34)
reboot system boot 2.6.18-128.1.10. Sun May 31 20:05 (00:03)


tune2fs -l /dev/hda1|grep -i mount|grep -v Maximum
This will show you the details of the server how many times mounted
(including server down/shutdown/reboot)
Note: /dev/hda1 denotes /boot partition of the server


Ex:
tune2fs -l /dev/hda1|grep -i mount|grep -v Maximum
Last mounted on: <not available>
Default mount options: user_xattr acl
Last mount time: Sun May 31 20:10:57 2009 -> last
rebooted/mount time of the /boot partion
Mount count: 6 -> Total server shutdown/reboot count


Have a nice day folks...!
chandranjoy
Site Admin
 
Posts: 283
Joined: Fri Oct 23, 2009 11:19 pm

Return to FAQ's

Who is online

Users browsing this forum: No registered users and 1 guest


cron