Solve the problem that Linux scheduled tasks cannot run

Source: Internet
Author: User
System environment (CentOS5) create a scheduled task in Linux: (1) configure the/etc/crontab file at the system running level, to execute all scripts under/etc/daily at every day, use the following format: user command script path or contents in the time-sharing day, month, and week...

System environment (CentOS 5)
Create a scheduled task in Linux:
(1) The first method is to configure the/etc/crontab file at the system running level. to execute all the scripts under/etc/daily at every day, the following format is used:
User command script path or directory by hour, day, month, and week
18 15 * root run-parts/etc/cron. daily
Note: run-parts is used to execute all scripts in the directory.
The user column must be filled in. generally, it is root.
If you only need to run a script, leave the command column empty (and do not need to *) and add the path directly after it, such as/etc/cron. daily/backup. sh (the script does not have to have a suffix)
After modification, the scheduled task service (service crond restart) needs to be restarted to take effect.
(2) The second method is user-level. execute the crontab-e command to directly add scheduled tasks. the format is similar to (1), but you do not need to specify a user, that is, the user column does not fill in anything (* No. is required), and the others are the same.

Related Article

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.