Get the App
SLTechnology News&Howtos  ›  Servers  › 

Analysis of crontab Task scheduling in Linux

Shulou Source: shulou.com Published: 2022-06-02 03:04:50 10月03日 Update

one。 Create a scheduled task

Instruction

Crontab-e enters the current user editing interface

Crontab-u user name-e enters the specified user editing interface

Enter the crontab task editing interface

Task writing format

# check the / ect directory every minute and write the contents of the directory under / tml/a.txt

* / 1 * ll / etc > > / tmp/a.text

# crontab object + instruction

# perform multiple tasks at the same time

# crontab object instruction 1 & instruction 2

Crontab object parameters

The first * indicates a minute range of 0-59

The second * indicates the hour range: 0-23

The third * indicates the day range: 1-31

The fourth * indicates the month range: 1-12

The fifth * indicates the range of days of the week: 0-7 (both 0 and 7 mean weekend)

The meaning of special symbols in crontab object

* means at any time

Represents multiple time points, such as 1 minute 2 * means 1 point and 2 points every day

-represents a closed interval of time.

* / N represents how often to execute

two。 View Task

Crontab-l view the tasks under the current user

Crontab-u user name-l View the tasks under the specified user

three。 Delete a task

Crontab-r deletes tasks under the current user

Crontab-u user name-r Delete tasks under the specified user

Summary

The above is the crontab task scheduling in Linux introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!

Tags: Task user scope object instruction representative time user name interface scheduling multiple directory help special three content source interval parameter at the same time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno macOS MySQL Redmi Linux