light102 发表于 2009-03-05 18:21

机器重启以后怎样查看机器上次运行多长时间?

怎样在机器重启后,查看重启前机器运行了多长时间?谢谢

ts99 发表于 2009-03-05 19:58

看下/etc/shutdownlog
计算下两次从起之间的时间差就是上次的运行时间了

light102 发表于 2009-03-06 08:59

没有发现shutdownlog

楼上,不好意思我们系统上没有发现shutdownlog日志。就下面两个文件。
# ls /etc/shut*
/etc/shutdown

/etc/shutdown.d:

李放 发表于 2009-03-06 10:16

uptime

sample:
uptime

10:17amup 75 days, 14:33,3 users,load average: 0.02, 0.01, 0.01

liuhui1000 发表于 2009-03-06 17:08

easy.
the command "uptime" can tell you the result.

ts99 发表于 2009-03-06 19:18

4,5楼没有看清楼主的问题,就说easy了。
如果没有/etc/shutdownlog就不好判断上次运行了多长时间了。那就看下OLDsyslog.log吧,关机时间和内核启动的时间做个差,应该可以大致的估算下此次重启前机器大概运行了多长时间。

ga0feng 发表于 2009-03-07 10:47

AIX跟Solaris的last命令可以查看reboot或者down机的时间,不知道hpux的是否可以?

honghong_jin 发表于 2009-03-08 17:39

老弟,shutdownlog 在/var/adm 下找。

light102 发表于 2009-03-08 18:17

谢谢 大家 我已经在/var/adm/logosm 文件计算出来了。谢谢

rock_l 发表于 2009-03-09 08:41

用#last reboot 不行么?
页: [1] 2
查看完整版本: 机器重启以后怎样查看机器上次运行多长时间?