Linux System Setup Timer task (crontab)

Source: Internet
Author: User

Edit with Crontab-e, then edit the routine tasks, then save and exit.

The specific format is described below:

The format of each line is: time-sharing Week command

The 1th column represents minutes 1~59 per minute with * or */1

The 2nd column represents the hour 1~23 (0 means 0 points)

The 3rd column represents the date 1~31

The 4th column represents the month 1~12

5th Column Identification Number Week 0~6 (0 = Sunday)

6th List of commands to run

It is worth noting that, in the crontab, either the command or the path of the file must be written in full , otherwise not recognized.

For example, to execute a/home/run/test.sh script at 6 o ' Day, you can configure the following:

0 6 * * */sbin/sh/home/run/test.sh

Or

0 6 * * * Cd/home/run &&/bin/sh test.sh

It is important to note that the commands in the test.sh script also need to use the full path, otherwise crontab cannot be found.

If you want to have some other requirements, such as preserving output, you can redirect the output, no difference from normal script operation.

0 6 * * * cd/home/run &&/bin/sh test.sh > Log

This article from "11295268" blog, declined reprint!

Linux System Setup Timer task (crontab)

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.