[Convert] cron syntax

Source: Internet
Author: User

Recently, when we started whenever, we found that we can use the cron syntax to set scheduled tasks. So we studied the cron syntax.

Every '0 0 27-31 ** 'do command "Echo 'you can use raw cron syntax too'" endcron command, used to set periodically executed commands. Format # file format description # -- minute (0-59) # | -- hour (0-23) # | -- Day (1-31) # | -- month (1-12) # | -- week (0-7) (Sunday = 0 or 7) # | # *** executed command 1, * Symbol: 30 18 *** # Do Something indicates that the command is run at every day. * Indicates any value. In this example, the values of day, month, and week are not considered. If * in front: ** 5 ** # Do something, the task runs every minute from AM to AM. 2. values separated by commas: 0 0, 5, 10 ** # Do Something indicates that the command is run at 00:00 on the first, 1st, and 5th days of a month. 3, range: 0 0 ** 1-5 # Do something1-5 means to run the command ls from Monday to Friday at 00:00 every day. 4. If both days and weeks are specified, they are all running relationships. 0 0 10*1 # Do something run the command on the 10th day of each month and every Monday. 5. The slash */10 ***** # Do Something indicates that the command is run every 10 minutes. If it is 0-10/5, it indicates that it runs every 5 minutes within the first 10 minutes of each hour. * 10/2 *** # Do Something indicates that it runs every second at an interval of two hours starting from 10th hours every day. The cron syntax can only be accurate to minutes. It is very useful when used with whenever.

[Convert] cron syntax

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.