Linux Task Scheduler

Source: Internet
Author: User

1. at--to perform a task at some point in the future

Usage examples:

at time: Set a point in time

At>command

At>ctrl+d

Specify time:

Absolute Time: HH:MM,DD. Mm. Yy,mm/dd/yy

relative Time: now+3minutes

units: minutes, hours, days, weeks

Blur time: Noon,midnight,teatime

Execution result of the command: sent to the user who scheduled the task in the form of a message

Show Jobs list: ATQ = at-l

Delete Jobs task: ATRM = at-d Jobs

2, crontab--periodic execution of a task

cron: Self is a service that runs uninterrupted

Anacron:cron, can be implemented to enable Cron to perform tasks that have not been performed in the past time for various reasons in return for normal execution once


Cron:

System cron Task:/etc/crontab

User tasks for time-sharing and lunar weeks

User cron task:/var/spool/cron/username

Time-sharing week task

Valid values for time:

points: 0-59

Hours: 0-23

Day: 1-31

Month: 1-12

Week: 0-7,0 and 7 both indicate Sunday


Time-pass representation:

*: All valid values corresponding to

3 * * *: 3 minutes per hour of execution

13 12 * *: 12:13 per day

,: Discrete point in time:

10,40 * * *: 10 minutes and 40 minutes per hour (half-hour execution)

-: Continuous point in time:

10 02 * * 1-5: Weekly from Monday to Friday 2:10 execution

/: How often does the corresponding value range be executed

*/3 * * *: Executes every three minutes


Example:

executes once every two hours: 01 */2 * * *

execute once every two days: 01 02 */2 * *

Note: The first minute must give the specific value, the second minute and the time must give the specific value


Note:cron executes all commands to go down the path specified by the PATH environment variable, the absolute path should be written in the cron task, and the script should define path.


Management of User tasks:

crontab

-L: Lists all cron tasks for the current user

-E: Edit

-R: Remove All Tasks

-u USERNAME: Managing cron tasks for other users


Linux Task Scheduler

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.