Home  >  Article  >  Operation and Maintenance  >  Can centos be set to automatically shut down?

Can centos be set to automatically shut down?

WBOY
WBOYOriginal
2022-02-09 15:47:263584browse

centos can set automatic shutdown; in centos, you can use the shutdown command to set automatic shutdown. This command can be used to perform the shutdown process. When the parameter is set to "-h", you can set the automatic shutdown. Time, the syntax is "shutdown -h automatic shutdown time".

Can centos be set to automatically shut down?

The operating environment of this article: centos 6.4 system, Dell G3 computer.

Can centos be set to automatically shut down?

Linux shutdown command can be used to perform the shutdown process and send messages to all programs being executed by the user before shutting down. Shutdown can also be used to restart the computer. .

Usage permissions: System administrator.

Syntax

shutdown [-t seconds] [-rkhncfF] time [message]

Parameter description:

-t seconds: Set the shutdown procedure after a few seconds.

-k : It will not actually shut down the computer, it will just send a warning message to all users.

-r : Shut down and then restart.

-h : Stop after shutdown.

-n: Instead of using normal procedures to shut down, forcefully kill all running programs and then shut down automatically.

-c : Cancel the shutdown action currently in progress.

-f: When shutting down, do not perform fsck action (check Linux file system).

-F: When shutting down, force the fsck action.

time: Set the shutdown time.

message : Warning message sent to all users.

Examples are as follows:

1: Shut down the Linux system immediately, where now is equivalent to the state of time 0

[root@db-server ~]# shutdown -h now

2: The system will restart after 2 minutes, Where m means shut down or turn on the computer after a few minutes.

[root@db-server ~]# shutdown -r +2

3: Set the system to shut down at that point in time

[root@db-server ~]# shutdown -h 12:30

or execute it in the background

[root@db-server ~]# shutdown -h 12:30 &

It is best to use the command & to process the shutdown command in the background. It does not affect other current operations.

Recommended tutorial: "centos tutorial"

The above is the detailed content of Can centos be set to automatically shut down?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn