Detailed mission plan

Source: Internet
Author: User

We write the tasks that the system performs as scripts, but we do not want to execute them immediately, but we schedule them to run at some future time, which is called a task plan, and we divide the execution plan into two types, and we'll talk about it a little bit.

To perform a task at a certain point in the future, you can use the At,batch command:

1. At command:

Format: At time---here must be the time of the future, input will give an at prompt

At>command----Enter the command to execute at the at prompt, you can write multiple commands

At>ctrl+d----Use Ctrl+d to submit a task after a time setting up a task to perform

Specify the time method:

Absolute time: hh:mm DD. Mm. YY Mm/dd/yy

Relative Time: now+# units: Minues, hours, days, weeks

Fuzzy Time: Noon "12 o'clock in the Morning", Midnight "Midnight 12 O'Clock", teatime "commonly known as afternoon tea time, the equivalent of 4 o'clock in the afternoon"

Supplemental: The execution result of the command will be sent as a message to the user who scheduled the task

-----------------------------------------------------------

Assign a task schedule to the system to be executed in 1 minutes

[Root@localhost ~]# at Now+1minutes

At> Ls/var

At> Cat/etc/fstab

At> <EOT>

Job 1 at 2013-03-30 23:41

-------------------------------------------------------------

Two options that are commonly used in the AT command:

At-l: View the status of the execution job, equivalent to ATQ

at-d Job number = ATRM Job number: End a job

------------------------------------------------------------------------

[Root@localhost ~]# At-l

1 2013-03-30 23:41 a root

--The first field indicates a few jobs

--The second field represents the job execution time

--The third field represents the job queue, and different queue names can be different for the job category, and the default is a

--The fourth field indicates which user initiated the job

[Root@localhost ~]# at-d 1

----Indicates that the system is not being executed for a scheduled task

-------------------------------------------------------------------------

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.