9-centos timed task-not working-no path indicated!!!

Source: Internet
Author: User

Crond is a daemon that is used to periodically perform certain tasks or wait for certain events under Linux, similar to Scheduled tasks under Windows, when the operating system is installed, the Service tool is installed by default and the Crond process is started automatically. The Crond process periodically checks to see if there is a task to perform and automatically executes the task if there are tasks to perform.

The task scheduling under Linux is divided into two categories, system task scheduling and user task scheduling.

System task scheduling: The work to be performed by the system periodically, such as writing cache data to hard disk, log cleanup, etc. In the/etc directory there is a crontab file, this is the System Task Scheduler configuration file.

Service Crond start//Start Services service Crond stop//Shutdown Services Service Crond restart//Restart Services service Crond reload//Reload configuration View crontab Service status: Service Crond Status Manual start crontab services: Crond start

  

The above 1-4 lines start, stop, restart the service, and reload the configuration, respectively.

To set cron to start automatically at boot time, add/sbin/service crond start in the/etc/rc.d/rc.local script

View current user's crontab, enter crontab -l ;

Edit Crontab, enter crontab -e ;

Delete Crontab, entercrontab -r

Add a task

CRONTAB-E 0 */1 * * * Command 0 */2 * * command

Whether the query task is added:

Crontab-l-U root #查看root用户 0 */1 * * Command 0 */2 * * command

Note: The task to be performed is to indicate the path, otherwise it will not work:

Basic format:

* * * * * command

Time-sharing Weekly 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



9-centos timed task-not working-no path indicated!!!

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.