How Linux creates Scheduled tasks

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.