Edit with Crontab-e, then edit the routine tasks, then save and exit.
The specific format is described below:
The format of each line is: time-sharing Week 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
It is worth noting that, in the crontab, either the command or the path of the file must be written in full , otherwise not recognized.
For example, to execute a/home/run/test.sh script at 6 o ' Day, you can configure the following:
0 6 * * */sbin/sh/home/run/test.sh
Or
0 6 * * * Cd/home/run &&/bin/sh test.sh
It is important to note that the commands in the test.sh script also need to use the full path, otherwise crontab cannot be found.
If you want to have some other requirements, such as preserving output, you can redirect the output, no difference from normal script operation.
0 6 * * * cd/home/run &&/bin/sh test.sh > Log
This article from "11295268" blog, declined reprint!
Linux System Setup Timer task (crontab)