crontab command format

Source: Internet
Author: User

1th column min 1~59
2nd Hour 1~23 (0 = midnight)
3rd Liege 1~31
4th Column Month 1~12
5th Column Week 0~6 (0 = Sunday)
6th List of commands to run

Here is the format for crontab:
Time-sharing day and month command to run

Here are some examples of crontab file entries:

21:30 restart Apache per night:

* * * * */usr/local/apache/bin/apachectl restart

4:45 restarts Apache on 1, 10, 22nd of each month:

4 1,10,22 * */usr/local/apache/bin/apachectl restart

1:10 restarts Apache per Saturday, Sunday:

1 * * 6,0/usr/local/apache/bin/apachectl restart

Restart Apache every 30 minutes from 18:00 to 23:00 every day:

0,30 18-23 * * */usr/local/apache/bin/apachectl restart

The above example shows the restart of Apache for every Saturday at 11:00AM:

0 * * 6/usr/local/apache/bin/apachectl restart

Restart Apache every hour:

* */1 * * * */usr/local/apache/bin/apachectl restart

From 11 o'clock to 7 in the morning, restart Apache every hour:

* 23-7/1 * * * */usr/local/apache/bin/apachectl restart

4th per month with 11-point restart from Monday to Wednesday Apache:

0 4 * Mon-wed/usr/local/apache/bin/apachectl restart

4-point restart of Apache on January 1

0 4 1 Jan */usr/local/apache/bin/apachectl restart




crontab command format

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.