Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux ftpshut Command

Linux ftpshut Command

Linux Command Reference Linux Command Reference

The Linux ftpshut command shuts down the FTP server at a specified time.

ftpshut It allows system administrators to shut down the FTP service at a specified time and send warning messages to connected FTP users before shutting down.

This command is typically used for system maintenance, upgrades, or other scenarios that require temporarily stopping the FTP service.

code>ftpshut If the shutdown time is set to "none", the server shuts down immediately. Using the "+30" format means the server shuts down in 30 minutes. Using the "1130" format means the server shuts down daily at 11:30, in 24-hour format.

After the FTP server is shut down, a file named shutmsg is created in the /etc directory; deleting it re-enables the FTP server.

Syntax

ftpshut [选项] [时间] [警告消息]

Parameters:

- `%s`: the time when the FTP service shuts down. - `%r`: the time when the FTP service restarts after shutdown. - `%d`: the remaining time before shutdown (in minutes).

** Common options:**

Example

To shut down the FTP server at 11:00 PM, reject new FTP logins 5 minutes before, disconnect all ftp connections 3 minutes before, and issue a warning message, use the following command:



ftpshut-d 3 -1 5 1100 "Server will be shutdown at 23:00:00" 

If you want to shut down the FTP service in 10 minutes and send users a warning message, use the following command:



ftpshut +10 "FTP 服务将在 %s 关闭,请尽快完成操作。"

In this example,+10 means shut down the FTP service in 10 minutes,"FTP 服务将在 %s 关闭,请尽快完成操作。" is the warning message sent to users,%s is replaced by the actual shutdown time.

If you want to shut down the FTP service at 3:00 PM, use the following command:



ftpshut 1500 "FTP 服务将在 %s 关闭,预计在 %r 重新启动。"

In this example,1500 means shut down the FTP service at 3:00 PM,"FTP 服务将在 %s 关闭,预计在 %r 重新启动。" is the warning message sent to users,%s and %r is replaced by the actual shutdown and restart times.

If you want to reject new user logins 5 minutes before shutting down the FTP service, use the following command:



ftpshut -l 5 +10 "FTP 服务将在 %s 关闭,请尽快完成操作。"

In this example,-l 5 means reject new user logins 5 minutes before shutdown,+10 means shut down the FTP service in 10 minutes.

If you want to disconnect all users 2 minutes before shutting down the FTP service, use the following command:



ftpshut -d 2 +10 "FTP 服务将在 %s 关闭,请尽快完成操作。"

In this example,-d 2 means disconnect all users 2 minutes before shutdown,+10 means shut down the FTP service in 10 minutes.


Notes

Linux Command Reference Linux Command Reference