Linux System timing Tasks

Source: Internet
Author: User

Some of the commands commonly used by crontab are as follows

sudo crontab-l #显示所有的定时任务 sudo crontab-e #编辑任务 sudo crontab-r #删除所有的任务

Editing a task is written as follows:

Echo " Hello World " " Hello World "
Five * indicates minute-minutes, any integer from 0 to 59 hour-hours, any integer from 0 to 23 day-date, any integer from 1 to 31 (if the month is specified, must be a valid date for that month) month-month, from Any integer between 1 and 12 (or using the abbreviated abbreviation of the month such as Jan, Feb, etc.) dayofweek-week, any integer from 0 to 7, where 0 or 7 stands for Sunday (or use the English shorthand of the week such as Sun, Mon, etc.) in addition to the numbers there are a few special The symbol * / - ,, where * represents all the values within the range of numbers, "/" represents each of the meanings, "*/2" represents every 2 units, "-" represents a number from one digit to a number, "," separates several discrete numbers. Here are a few examples to illustrate the problem:
0 6* * *Echo "Good morning.">>/tmp/morning.txt #每天早上6点打印Good Morning0*/2* * *Echo "There is a break now .">>/tmp/test.txt #每两个小时0  at-7/2,8* * *Echo "a good dream:)">>/tmp/Test.txt #晚上11点到早上8点之间每两个小时, eight in the morning.0  One 4*1-3 Echo "a">>/tmp/test.txt #每个月的4号和每个礼拜的礼拜一到礼拜三的早上11点

Reference: http://blog.csdn.net/flyhawk007blog/article/details/2689678

Linux System timing Tasks

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.