rfmoz / tuptime

Report historical and statistical real time of the system, keeping it between restarts. Like uptime command but with more interesting output.
GNU General Public License v2.0
288 stars 40 forks source link

need reboot count using tuptime --tsince -86400 for past 24 hrs #53

Closed svshubham01 closed 5 years ago

svshubham01 commented 5 years ago

Hi, i need the reboot count of the server in the past 24 hrs, found that tuptime --tsince -86400 returns the system info for the past 24 hrs, can anyone help to get the reboot count. Thanks In Advance

rfrail3 commented 5 years ago

Hi,

The default output have all the information that you need, from the "System startups" line, you can get the reboots count, which is equal to startups minus one:

tuptime --tsince -86400 --csv | grep 'System startups' | awk -F\" '{print $4 -1}'

svshubham01 commented 5 years ago

Hi, Thanks for the quick response.

tuptime --tsince -86400 --csv | grep 'System startups' | awk -F\" '{print $4 -1}'

you mean this command returns me the reboot count for the past 24 hours?

rfrail3 commented 5 years ago

Yes, it is.

svshubham01 commented 5 years ago

Thanks a lot for your help.. I tested it out and found that it works perfectly for me... :)