How can you do ops? Create a scheduled task!
1.at: Used to create a temporary task, the command no longer takes effect after the task is completed
The most common is the shutdown or restart of the server.
[[Email protected] Desktop]# at 19:00
At>/sbin/shutdown-h now<EOT> It's best to enter the absolute path of the command
If you do not know the absolute path of the command can be viewed by which+ space + command
Job 4 at 2017-02-27 19:00
PS: The red font is automatically generated after ctrl+d after the absolute path of the input command
View commands can be used ATQ or at-l
[Email protected] ~]# at-l
12017-02-27 19:00 a root
[Email protected] ~]# ATQ
12017-02-27 19:00 a root
[Email protected] ~]#
2. #crontab-E
Go to edit text
Enter in text: * * * */sbin/shutdown-h now
When you are finished editing, press: Wq Save to exit
So the server will shut down automatically at 03:30 minutes a day.
Crontab Main parameters
-L: List current Scheduled tasks
-R: Delete the current scheduled task
-E: Perform a text editor editing a scheduled task
This article is from the "12619984" blog, please be sure to keep this source http://12629984.blog.51cto.com/12619984/1901837
How Linux creates Scheduled tasks