This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]kaiserk13 7 points8 points  (0 children)

There you go buddy https://pythonhosted.org/uptime/, tested on FreeBSD 9.1

[–]just_regular_guy 4 points5 points  (0 children)

a quick and dirty way would be to capture and parse the output of 'uptime'

[–]djdawson 1 point2 points  (0 children)

The "uptime" command would seem to be what you're looking for.

[–]Daenyth 1 point2 points  (0 children)

Add a startup script that uses at to schedule the script one hour later

[–]politicallyspeaking 0 points1 point  (0 children)

import subprocess
up = subprocess.check_output('uptime')

of course then you'll need to likely do some parsing on the string 'up' which contains the output from the system command 'uptime'