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