Scheduled Tasks Linux Cron Job Preliminary use

Source: Internet
Author: User

The command to view a timed task is: crontab-l the command to edit a timed task is: CRONTAB-E (effective immediately after editing if comments can be added at the beginning of the line with # and VI) Timed task description each action a task

Each line is divided into six sections, each separated by a space and separated by commas.

Minute hour day_of_month month weekday command

Using * in the first five fields means all points in time

minute:0-59

Hour:0-23,0 stands for 0 points

Day_of_month:1-31

Month:1-12

weekday:0-6,0 stands for Sunday, 1-6 for Monday to Saturday

Command: Scripts or commands that need to be executed

Example:

1. * * * * */home/habao/test_cron.sh per minute

2. */2 * * * * echo "I am crontab" >>/home/zhang/hello

In two minutes, I'm going to write I am crontab in the hello file.

Note: Echo needs to write full path/bin/echo or execute alias echo= "/bin/echo"


/sbin/service Crond Start//Startup service

/sbin/service Crond stop//Shut down service

/sbin/service crond Restart//Restart service

/sbin/service Crond Reload//Reload Configuration

Reference: http://www.xshell.net/linux/crontab-3.html

Http://www.2cto.com/os/201109/105474.html


Scheduled Tasks Linux Cron Job Preliminary use

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.