Timed Tasks for Linux

Source: Internet
Author: User

Divided into two types: one-time scheduled tasks, periodic scheduled tasks.

a one-time scheduled task , also known as the at Timed task, the command for ATD, here D is the deamon of the first letter, the Guardian meaning, refers to the Guardian process; in fact, many programs end in D, such as httpd, memcached and so on.

The ATD service is installed by default on Linux, and can be Chkconfig--list | grep at To view (it is said that CentOS 7 has changed, need to use Systemctl to view, find it yourself), or use service ATD status to view it.

Periodic Scheduled Tasks , crontab (using quartz shoes should look familiar, in fact, from here).

Linux crontab timed tasks are in fact divided into two categories: crontab-e self-editing (only current user, root except), the system's crontab scheduled tasks (including Annacron).

CRONTAB-E will enter a VI interface, where you can set the way and task of execution, in the following format:

* * * * * task

5 asterisks, which in turn represent minutes, hours, days, months, and weeks.

Each asterisk can be used to stitch multiple numbers with commas, or to use dashes to represent ranges, and to use slashes and number n to represent every nth period of time.

Such as:

1,5,7 * * * * task refers to 1, 5, 7 minutes of each hour will perform a task

3-10 * * * task refers to 3-10 minutes per hour to perform a task every minute

*/10 * * * * task means a task is performed every 10 minutes

It is important to note that the minimum time unit is minutes, the maximum time unit is month, and therefore the concept of seconds and years is not supported.

Also, if you specify both days and weeks, that is the set, not the intersection! This means that every day is triggered, not at the same time.

CRONTAB-L Lists all crontab scheduled tasks for the current user.

Crontab-r removes all crontab scheduled tasks from the current user.

Not to be continued

Timed Tasks for Linux

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.