Linux timed Tasks

Source: Internet
Author: User

Create a timed task for the current user to automate the program at a specific time.

1. First enter CRONTAB-E edit crontab service file

For example: File contents are as follows

#00 */1 * * * CD/HOME/WORK/LIHEHAN/QUBUILD/EXTRA; SH build.sh 1>>err.log 2>&1

0 7 4 * CD home/work/mapred; Nohup sh run.sh >> nohup.out 2>&1

Save exit

2. Type crontab-l to see if the Crontab service under the user is created successfully

3. crontab Command options:

    • -u Specifies a user
    • -l lists a user's task schedule
    • -R Delete a user's task
    • -e Edit a user's tasks

4. cron file Syntax:

Hour of the week order

0-59 0-23 1-31 1-12 0-6 Command (value range, 0 for Sunday One a row corresponds to a task)

Remember the meanings of several special symbols:

    • "*" represents a number in the range of values,
    • "/" stands for "every",
    • "-" represents a number to a number,
    • "," separate a few discrete numbers

Linux timed 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.