Home > System Tutorial > LINUX > How to send custom messages to other system users in Linux and close the messages sent to them before

How to send custom messages to other system users in Linux and close the messages sent to them before

PHPz
Release: 2024-01-09 20:58:04
forward
772 people have browsed it
Introduction As a system administrator, before you shut down a server, you may want to send a message to warn them that the system is about to shut down. By default, the shutdown command will broadcast information to other system users.

How to send custom messages to other system users in Linux and close the messages sent to them before

In a previous article, we explained the differences between shutdown, poweroff, halt, and reboot commands in Linux and revealed what they actually do when executing these commands with different options.

This article will show you how to send a customized message to all system users when the system is shut down.

Suggested reading: tuptime - Displays the historical and statistical running time of a Linux system.

As a system administrator, before you shut down a server, you may want to send a message to warn them that the system is about to shut down. By default, the shutdown command will broadcast this message to other system users as follows:

# shutdown 13:25
Copy after login

Linux shutdown operation broadcast message

Shutdown scheduled for Fri 2017-05-12 13:25:00 EAT, use 'shutdown -c' to cancel.
Broadcast message for root@tecmint (Fri 2017-05-12 13:23:34 EAT):
The system is going down for power-off at Fri 2017-05-12 13:25:00 EAT!
Copy after login

To send a custom message to other system users on the shutdown line, run the following command. In this example, shutdown occurs two minutes after the command is executed.

# shutdown 2 The system is going down for required maintenance. Please save any important work you are doing now!
Copy after login

How to send custom messages to other system users in Linux and close the messages sent to them before
Suppose you have some critical system operations, such as scheduled system backups or updates, that will be performed while the system is shut down, as shown below, you can use the -c option to cancel the shutdown and continue after performing these operations:

# shutdown -c
Copy after login

Linux shutdown operation cancellation message:

Shutdown scheduled for Fri 2017-05-12 14:10:22 EAT, use 'shutdown -c' to cancel.
Broadcast message for root@tecmint (Fri 2017-05-14 :10:27 EAT):
The system shutdown has been cancelled at Fri 2017-05-12 14:11:27 EAT!
Copy after login

Also, learn how to use simple and traditional methods in Linux: automatically execute commands/scripts on reboot or boot.

Now you know how to send a custom message to other system users before the system shuts down. Do you have any other thoughts you’d like to share on this topic?


The above is the detailed content of How to send custom messages to other system users in Linux and close the messages sent to them before. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template