Achieving Uptime in Yocto or Older Linux Machines – Linux Tips and Tricks

Achieving Uptime in Yocto or Older Linux Machines – Linux Tips and Tricks

HomeRabi GurungAchieving Uptime in Yocto or Older Linux Machines – Linux Tips and Tricks
Achieving Uptime in Yocto or Older Linux Machines – Linux Tips and Tricks
ChannelPublish DateThumbnail & View CountDownload Video
Channel AvatarPublish Date not found Thumbnail
0 Views
Discover how to improve the uptime of Yocto or older Linux machines.

Retrieve when the system was rebooted (on newer Linux machines)
Operating time -s

Cat /proc/operating time

OUTPUT
1812083.86 2618211.11

The first number indicates the total number of seconds the system was active.
The second number indicates how much time (in seconds) the machine was idle.

Get only the uptime
cat /proc/uptime cut -d '' -f1 cut -d.'' -f1

OUTPUT
1811896

Formatted date
eval /"echo (date -ud /"@(cat /proc/uptime cut -d' ' -f1 cut -d'.' -f1)/" '((%s/3600/24)) days %H hours %M minutes %S seconds')/"

OUTPUT
20 days 23 hours 19 minutes 54 seconds

#linux #ubuntu #redhat #bash

Please take the opportunity to connect with your friends and family and share this video with them if you find it useful.