Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Uptime

From Wikipedia, the free encyclopedia
Period when a computer system is available
This article is about uninterrupted system availability. For use in logistics, seeDowntime. For enterprise computing, seehigh availability. For the magazine, seeUpTime (disk magazine). For the first half of a double album by the Kleptones, seeUptime / Downtime § Uptime.

Uptime is ameasure of system reliability, expressed as the period oftime amachine, typically acomputer, has been continuously working and available. Uptime is the opposite ofdowntime.

Htop adds an exclamation mark when uptime is longer than 100 days.

It is often used as a measure of computeroperating system reliability or stability, in that this time represents the time a computer can be left unattended withoutcrashing or needing to berebooted for administrative or maintenance purposes.

Conversely, long uptime may indicate negligence, because some critical updates can require reboots on some platforms.[1]

Records

[edit]

In 2005,Novell reported a server with a 6-year uptime.[2][3] This level of uptime is common when servers are maintained under an industrial context and host critical applications such as banking systems.

Netcraft maintains the uptime records for many thousands ofweb hosting computers.

A server running NovellNetWare has been reported to have been shut down after 16 years of uptime due to a failing hard disk.[4][5]

Determining system uptime

[edit]

Unix-like systems (Linux, FreeBSD)

[edit]

Using uptime

[edit]

Most Unix-like systems includingLinux,FreeBSD,Mac OS X, andSySVr4 have theuptime command. It also displays the system load averages for the past 1, 5, and 15-minute intervals:

user@Linux$uptime  18:17:07 up 68 days,  3:57,  6 users,  load average: 0.16, 0.07, 0.06user@BSD$uptime3:01AM  up 69 days,  7:53, 0 users, load averages: 0.08, 0.07, 0.05

This command originated in3.0BSD and has become ubiquitous among Unix systems ever since.[6] Despite almost always providing the same collection of information and being so ubiquitous, it is not part of any Unix-related standard, neither SUS nor POSIX.

On Linux, theuptime command is part ofcoreutils.

On BSD, theuptime command ishard link to thew program.[7] Thew program is based on theRSTS/E,TOPS-10, andTOPS-20 SYSTAT program.[8]

Using system-specific interfaces

[edit]

Each Unix-like system also has its own private interfaces for obtaining the system uptime.

Linux
[edit]

On Linux, severalprocfs files provide information on the system uptime. The main file is/proc/uptime, but/proc/stat provides related information too.[9]

$cat/proc/uptime  350735.47 234388.90

The first number is the total number of seconds the system has been up. The second number is how much of that time the machine has spent idle, in seconds.[10] On multi-core systems (and some Linux versions) the second number is the sum of the idle time accumulated by each CPU.[11]

The C API for uptime information issysinfo().[12]

BSD
[edit]

On BSD systems andmacOS (a combination of BSD and XNU parts), the uptime information is available from thesysctl system, both in the form of thesysctl command and thesysctl() C function. The sysctl entry is calledkern.boottime, which provides boot time that can be converted to an uptime by subtracting it from the current time:[13]

$sysctlkern.boottimekern.boottime: { sec = 1271934886, usec = 667779 } Thu Apr 22 12:14:46 2010

macOS also provides the uptime asclock_gettime(CLOCK_MONOTONIC_RAW), a POSIX interface with implementation-defined starting point; macOS sets the starting point at system boot.[14]mach_timebase_info() andCACurrentMediaTime() are additional ways to access the same raw monotonic clock.

On FreeBSD (but not macOS), the kernel exports three symbols that can be used asextern variables in C to obtain the boot time and uptime. They are calledboottime,time_second, andtime_uptime. These require no function call at all to use, unlikesysctl().[15] Higher-precision uptime is provided from functions such asmicrouptime().[16]

Microsoft Windows

[edit]

Windows Task Manager

[edit]
Windows 7 Task Manager Performance tab screenshot.
Windows 7Task Manager Performance tabscreenshot

Some versions ofMicrosoft Windows include an uptime field inWindows Task Manager, under the "Performance" tab. The format is D:HH:MM:SS (days, hours, minutes, seconds).

systeminfo

[edit]

The output of thesysteminfo command includes a "System Up Time"[17] or "System Boot Time" field.

C:\>systeminfo| findstr"Time:"System Up Time:            0 days, 8 hours, 7 minutes, 19 seconds

The exact text and format are dependent on the language and locale. The time given bysysteminfo is not reliable. It does not take into account time spent insleep orhibernation. Thus, the boot time will drift forward every time the computer sleeps or hibernates.[citation needed]

NET command

[edit]

TheNET command with itsSTATISTICS sub-command provides the date and time the computer started, for both theNET STATISTICS WORKSTATION andNET STATISTICS SERVER variants. The commandNET STATS SRV is shorthand forNET STATISTICS SERVER.[18] The exact text and date format is dependent on the configured language and locale.

C:\>NET STATISTICS WORKSTATION| findstr"since"Statistics since 8/31/2009 8:52:29 PM

Windows Management Instrumentation (WMI)

[edit]

Uptime can be determined viaWindows Management Instrumentation (WMI), by querying theLastBootUpTime property of theWin32_OperatingSystem class.[19] At thecommand prompt, this can be done using thewmic command:

C:\>wmic os get lastbootuptimeLastBootUpTime20110508161751.822066+060

The timestamp uses the formatyyyymmddhhmmss.nnn, so in the above example, the computer last booted up on 8 May 2011 at 16:17:51.822. The text "LastBootUpTime" and the timestamp format do not vary with language or locale. WMI can also be queried using a variety ofapplication programming interfaces, includingVBScript orPowerShell.[20][21]

Uptime.exe

[edit]

Microsoft formerly provided a downloadable utility calledUptime.exe, which reports elapsed time in days, hours, minutes, and seconds.[22]

C:\>UptimeSYSTEMNAME has been up for: 2 day(s), 4 hour(s), 24 minute(s), 47 second(s)

The time given byUptime.exe is not reliable. It does not take into account time spent insleep orhibernation. Thus, the boot time will drift forward every time the computer sleeps or hibernates.[citation needed]

FreeDOS

[edit]

Theuptime command is also available forFreeDOS. The version was developed by M. Aitchison.[23]

OpenVMS

[edit]

OnOpenVMS systems, theshow system command can be used at theDCL command prompt to obtain the system uptime. The first line of the resulting display includes the system's uptime, displayed as days followed by hours:minutes:seconds. In the following example, the command qualifier/noprocess suppresses the display of per-process detail lines of information.[24]

$showsystem/noprocessOpenVMS V7.3-2 on node JACK 29-JAN-2008 16:32:04.67  Uptime  894 22:28:52

The command output above shows that node JACK on 29 January 2008 at 16:32:04.67 has an uptime of 894 days 22 hours 28 minutes and 52 seconds.

See also

[edit]
Look upuptime in Wiktionary, the free dictionary.
Wikibooks has a book on the topic of:Guide to Windows Commands

References

[edit]
  1. ^"How to install multiple Windows updates or hotfixes with only one reboot".Microsoft Knowledge Base. 2018-04-17. Retrieved2024-02-01.
  2. ^Kearns, Dave (2005-12-01)."Marathon servers".Network World. IDG Communications. Archived fromthe original on 2013-05-08. Retrieved2019-07-11.
  3. ^"Uptime Workhorses: Still Crazy after all these Years".Novell Cool Solutions: Trench. Novell. 12 Jan 2006. Archived fromthe original on 2019-09-06. Retrieved2019-07-11.
  4. ^Bright, Peter (2013-03-29)."Epic uptime achievement unlocked. Can you beat 16 years?".Arc Technica. Condé Nast. Retrieved2019-07-11.
  5. ^Axatax (2013-03-28)."So long to a valiant companion".Ars OpenForum. Condé Nast. Archived fromthe original on 2014-07-26. Retrieved2014-07-26.
  6. ^
  7. ^unknown;Bostic, Keith (October 21, 1988)."File usr.bin/w/Makefile artifact". University of California, Berkeley Computer Systems Research Group. RetrievedNovember 22, 2022.ln ${DESTDIR}/usr/ucb/w ${DESTDIR}/usr/ucb/uptime
  8. ^unknown;Joy, Bill (October 21, 1988)."File usr.bin/w/w.c artifac". University of California, Berkeley Computer Systems Research Group. RetrievedNovember 22, 2022.This program is similar to the systat command on Tenex/Tops 10/20
  9. ^
  10. ^Doleželová, Marie; Jahoda, Mirek; et al."/proc/uptime".Deployment Guide - Red Hat Enterprise Linux 6. Red Hat, Inc. Retrieved2018-12-12.
  11. ^Schwidefsky, Martin (2009-05-11)."Re: [PATCH] Re: /proc/uptime idle counter remains at 0".Linux kernel mailing list (Mailing list). Retrieved2014-04-22.
  12. ^sysinfo(2) – Linux System CallsManual from ManKier.com
  13. ^"Mac OS X Manual Page For sysctl(8)".Mac Dev Center. Apple. 2009-10-15. Archived fromthe original on 2010-01-14. Retrieved2014-04-22.
  14. ^"Getting iOS system uptime, that doesn't pause when asleep".Stack Overflow.
  15. ^boottime(9) – FreeBSD Kernel Developer'sManual
  16. ^binuptime(9) – FreeBSD Kernel Developer'sManual
  17. ^Shultz, Greg (2005-08-10)."Tracking down uptime in Windows XP".TechRepublic. CBS Interactive. Archived fromthe original on 2012-07-08. Retrieved2014-04-22.
  18. ^Sinay, Yuval (2006-10-25)."How to find Windows uptime?".Microsoft Knowledge Base. Microsoft. Retrieved2014-04-22.
  19. ^"Win32_OperatingSystem class". Microsoft. 2018-05-30. Retrieved2019-07-11.
  20. ^"How Can I Tell if a Server has Rebooted?".Hey, Scripting Guy! Blog. Microsoft. 2004-09-07. Archived fromthe original on 2010-05-01. Retrieved2014-04-22.
  21. ^"How Can I Determine the Uptime for a Server?".Hey, Scripting Guy! Blog. Microsoft. 2005-08-02. Archived fromthe original on 2010-05-15. Retrieved2014-04-22.
  22. ^"Uptime.exe Tool Allows You to Estimate Server Availability with Windows NT 4.0 SP4 or Higher".Microsoft Knowledge Base. Microsoft. 2012-08-20. Archived fromthe original on 2014-04-24. Retrieved2014-04-22.
  23. ^Aitchison, M. (1998-04-15)."Package uptime in group Unix-like".ibiblio.org. Archived fromthe original on 2019-07-17. Retrieved2019-07-11.
  24. ^"Undocumented OpenVMS Features". PARSEC Group. 2008-10-29. Archived fromthe original on 2011-05-11. Retrieved2014-04-22.
File system
Processes
User environment
Text processing
Shell builtins
Searching
Documentation
Software development
Miscellaneous
File system
Text utilities
Shell utilities
Ecosystem
Interpreters
Terminals
File system navigation
File management
Archiving
Disk management
Processes
Registry
User environment
File contents
Scripting
Networking
Maintenance and care
Boot management
Software development
Miscellaneous
Retrieved from "https://en.wikipedia.org/w/index.php?title=Uptime&oldid=1325857023"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp