Shell learns 57 days----Linux task management, summarizing and extending to the previous lecture

Source: Internet
Author: User

Linux task Management

There are two types of task management under Linux , each of which is one-time and periodic . Disposable is at and the Batch, periodicity is divided into the system regardless of what and user tasks .

Disposable Tasks :

1. Command format : at [ options ] time

2. Options :

Option name

Description

-I ( uppercase I)

Specify a queue

-F

Specify file

-L ( lowercase l)

View queues

-D

Delete queue

3.time:teatime noon Midnight Teatime tomorrow Now

4, operation mode: With at command has interactive mode and batch processing two ways.

Interactive is when the user enters at [option] time and waits for the user to continue entering the command to run at the cursor, and then submits the task with ctrl+d . The batch is going to use -F. is the command that the user will run to write to the file, and then use - f to specify the file.

5. Running result: The result of the operation will be sent to the user in the likeness of the mail.

6, and batch difference:Batch can not specify the time, but choose the user system spare time to run.

Recurring tasks:

How it works: Both the system task and the user task are run by the daemon crond reading the user-defined file. When the system task file is /etc/crontab, the user task file is /var/spool/cron/username.

System tasks:

Task definition Format: Each row defines a task. Format is * * * user command

Time Format:*-./ is a symbol that can be used. * represents all the desirable values for this bit. - represents a continuous value in this interval. . represents the discrete value of this interval, /# indicates that at intervals of # run a task once

User tasks:

Command: Use the crontab command. The number of parameters that can be used is the- e call editor in editor to edit,-u Specify user,-l View tasks,-r Delete crontab files.

Examples:

How to achieve a second-level task:* * * * * * for i in {1...4};d o/bin/echo "Hello"; Sleep 1;done

Not divisible how to solve: available at run. Write in the file while true;do ls/sleep 10;done

In addition to the crontab , another command is a supplement to crontab ,anacron.

It is used to detect If a task in the crontab has missed the last run time, and if so, let the task run at some time after power-on.

Shell learns 57 days----Linux task management, summarizing and extending to the previous lecture

Related Article

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.