Linux System Command Learning Series-Routine task management at command

Source: Internet
Author: User

Let's review the previous section:

1. Switch User identity command su

2. Execute the action command as root sudo

3. Job: Configure sudo permissions to User1, do not use password, can execute Useradd command

Add the following configuration entry in the/etc/sudoers file

User1 all= (All) nopasswd:/sbin/useradd


In this section, let's take a look at two commands for routine task management.

What is a routine task? A timed occurrence of one or more recurring operations, called a routine task. There are two commands in Linux, one is at for execution at a particular time, and Cron commands are used to perform recurring tasks.


1. At command


Basic usage at time, you first specify an hour, and you are prompted to enter the command to execute at that time, such as:

EOT is the system output after we execute the CTRL+D command, indicating the end of the input.

Above is what we use ll command to do as a task in 5 minutes after execution

Use At–l or ATQ to view the list of tasks,

From the list we can see the ID of the task and the task execution time, as well as the creator of the task.

View task details using the AT–C task ID

Above, only the most core information is displayed, you can see our command is LL.

The time format of the AT command can be

Minute??? At now + 5 minutes?? The task runs after 5 minutes
Hour????? At now + 1 hour????? The task runs after 1 hours
Days????? At now + 3 days????? The task runs after 3 days
Weeks???? At now + 2 weeks???? The task runs after two weeks
Fixed???? At midnight????????? Task runs at midnight
Fixed???? At 10:30pm?????????? Task at 10:30 in the evening

Fixed???? At 23:59 12/31/2018 Mission on December 31, 2018 23:59

You can delete a task by using the AT–D task ID or the ATRM task ID

Job: Create a task, shut down after 10 minutes, the command to shut down the machine is shutdown


Free video tutorial on public number "get kicked genius" gets

Linux System Command Learning Series-Routine task management at command

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.