Linux crontab and linuxcrontab

Source: Internet
Author: User

Linux crontab and linuxcrontab

Write a little bit every day. One day, the salted fish will become more salty.

 

The cron service is a linux scheduled execution tool that can run jobs without manual intervention. The frequency can be divided

Minute hour day month week, format:

 

 


1. crontab service:

Service crond start service

Service crond stop service

Service crond restart service

Servcie crond reload hot update

View service crond status

Crontab-e: Modify scheduled task content

 

2. cron configuration file directory

In the/var/spool/cron/directory, the scheduled task configuration file of each user in the system will exist. It is generally named after the user name, therefore, when you use the crontab-e command to modify a scheduled task, you must check whether your current user permissions are correct.

 

3. crontab usage

 Crontab is used to add, modify, and delete scheduled tasks. each user has his/her own crontab file. The crontab format is as follows:

Min hour day mon week order

Instance:

0 0 ***/home/ubuntu/tets. sh

Run the test. sh script at every day.

-L timed task output

-R Delete

-E modify

4. crontab instance

 0 6 ***/home/ubuntu/test. sh>/home/ubuntu/test. log

Run the test. sh script at every morning and write the script output to the test. log file.

0 */1 ***/home/ubuntu/test. sh>/home/ubuntu/test. log

Run test. sh every hour.

1/*****/home/ubuntu/test. sh>/home/ubuntu/test. log

Run test. sh every minute.

0 11-23/2 ***/home/ubuntu/test. sh>/home/ubuntu/test. log

Run test. sh every two hours from to every day.

0 0 1 **/home/ubuntu/test. sh>/home/ubuntu/test. log

Executed on the 1st day of every month

0 0 ** 3/home/ubuntu/test. sh>/home/ubuntu/test. log

Execute at every Wednesday

 

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.