Get Linux uptime seconds

user-pic
Vote 0 Votes

cat /proc/uptime
35115009.84 28744638.57

第一個數字是開機秒數
第二個數字是 Idle 秒數

若 crontab 裡要設條開機後一個小時才執行某動作, 可以這樣設定
[ `cut -d. -f1 /proc/uptime` -gt 3600 ] && some-script

ref. /proc/uptime

Leave a comment

About this Entry

This page contains a single entry by Pank published on July 31, 2012 1:57 PM.

ASUS O!Play Mini Plus was the previous entry in this blog.

Sha256sum for Windows is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives