At/atq/atrm

Source: Internet
Author: User

AT command

Process and Job Management

The at command is used to execute commands at a specified time. At allows you to use a fairly complex set of time-specific methods. It is able to accept the time specified in the hh:mm (hour: minute) of the day. If the time has passed, then it will be executed the next day. Of course, you can use Midnight (late night), noon (noon), Teatime (tea time, usually 4 o'clock in the afternoon) and other vague words to specify the time. The user is also able to use the 12-hour timekeeping system, which is either a AM (morning) or PM (afternoon) After the time to indicate whether it is morning or afternoon. You can also specify a specific date for the execution of the command, specifying the format for Month Day (month) or mm/dd/yy (Month/day/year) or Dd.mm.yy (day, month, year). The specified date must be followed by the specified time.

The absolute timing method is described above, and the relative timing method can be used, which is good for arranging orders that will be executed soon. The specified format is: now + count time-units , now is the current time, Time-units is the time unit, here can be minutes (minutes), hours (hours), Days (day), Weeks (week). Count is the amount of time, whether it is a few days, or a few hours, and so on. A more timed method is to specify the time to complete the command directly using today, tomorrow (tomorrow).

Grammar
at (option) (parameter)
Options
-F: Specifies the task file that contains the specific instructions;-Q: Specifies the queue name of the new task;-L: Displays a list of pending tasks;-D: Deletes the specified pending task;-M: Sends e-mail to the user after the task execution is complete.
Parameters

DateTime: Specifies the date and time when the task executes.

Instance

Three days after 5 o'clock in the afternoon Chung execution /bin/ls :

At>/bin/lsat> <eot>job 7 at 2013-01-08 17:00

Tomorrow 17 o'clock, the output time is within the specified file:

At> >/root/2013.logat> <eot>job 8 at 2013-01-06 17:20

After the scheduled task is set, we can use the atq command to see that the system does not perform a work task until it is executed:

8 2013-01-06 17:20 A root7 2013-01-08 17:00 a root

To delete a task that has already been set:

8 2013-01-06 17:20 A root7 2013-01-08 17:00 a root8 2013-01-06 17:20 a root

Displays the contents of the task that has been set:

#!/bin/sh# Atrun uid=0 gid=0# mail root 0 22 omit n characters here date >/root/2013.log

=====================================================================

ATRM command

Process and Job Management

The ATRM command is used to delete the specified task in the pending task queue.

Grammar
ATRM (option) (parameter)
Options
-V: Displays the version number.
Parameters

Task Number: Specifies the task to be deleted in the queue to be executed.

Instance

Delete a task that is already queued

2 Mon 08:00:00 a root1 Sat may 17:00:00 a root

This article is from "Xiao Bao Bao" blog, please be sure to keep this source http://gongxiaoyi.blog.51cto.com/7325139/1682573

At/atq/atrm

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.