You can use the uptime
command in the command line to get the system uptime. You can execute this command using Ruby's subprocess
module as follows:
main.rb272 chars14 lines
This will output the system uptime in the format of days, hours, and minutes. For example: "7 days, 3:12"
gistlibby LogSnag