Linux timed Execution Shell script command crontab

Source: Internet
Author: User

Crontab can execute a shell script and execute a series of Linux commands at a specified time

Example: Server administrator regularly backs up database data, logs, etc.

Detailed

Common commands:

Crontab–e     //Modify the crontab file, if the file does not exist, it will be created automatically. Crontab–l      //display crontab file. Crontab-r      //delete crontab file. Crontab-ir     //delete crontab file before reminding the user. Service Crond Status     //view crontab Services Crond start//     Start Services service Crond stop     //Shut Down Services service Crond Restart     //Restart Services service Crond reload     //Reload Configuration

Basic format:

* * * * * command
Time of day and month command

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

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

The 3rd column represents the date 01~31

The 4th column represents the month 01~12

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

6th List of commands to run

Some examples:

1. Run at 00:10

0 * * */home/swz/aa.sh

2, the backup job every weekday 23:59.

* * 1,2,3,4,5/home/swz/aa.sh   or  1-5/home/swz/aa.sh

3. Run a command every minute

*/1 * * * */home/swz/aa.sh

4, 1th number 14:10 per month to run

1 * */home/swz/aa.sh

5, every 10 minutes to request an address regularly

0 */10 * * */usr/bin/curl http://www.aaa.com/index.php

Linux timed Execution Shell script command crontab

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.