1. See if the service is running
Ps-aux | grep cron
2. New Scheduling task
There are two ways to add a dispatch task:
1), at the command line input: CRONTAB-E and then add the corresponding task, Wq save the disk to exit.
2), directly edit the/etc/crontab file, that is, vi/etc/crontab, add the corresponding task.
3.
How the Task Scheduler settings file is written
The CRONTAB-E command can be used to edit, edit the corresponding user's cron file under/var/spool/cron, or modify the/etc/crontab file directly.
The specific format is as follows:
Minute Hour Day Month Dayofweek command
Minutes hours days months days per week order
Each field represents the following meanings:
Minute the first few minutes of every hour to perform the task
Hour the first few hours of the day to perform this task
Day of the month to perform the task
Month months of the year to perform this task
DayOfWeek the day of the week to perform the task
Command Specifies the program to execute
In these fields, other fields are optional except that the Command is a field that must be specified each time.
field, depending on your needs. For a field that is not specified, "*" is used to fill its position.
Examples are as follows:
5 * * * ls Specifies the first 5 minutes of every hour to execute the LS command
5 * * * ls specifies the 5:30 execute LS command per day
7 8 * * ls specifies 7:30 minutes of 8th per month to execute the LS command
5 8 6 * ls specifies that the LS command be executed every June 8 5:30
6 * * 0 ls specifies 6:30 execute ls command per Sunday [Note: 0 for Sunday, 1 for Week 1,
And so on, can also be expressed in English, Sun said Sunday, Mon said Monday and so on. ]
3 10,20 * * ls 3:30 for each month 10th and 20th executes the LS command [note: "," used to connect multiple discontinuous periods]
8-11 * * * ls command is executed at 25 minutes per day at 8-11 Pips [Note: "-" used to connect a continuous period of time]
*/15 * * * * ls is executed every 15 minutes with the LS command [i.e. No. 0 15 30 45 60 minutes per hour to execute the LS command]
6 */10 * ls command is executed every 10 days each month (1, 11, 21, 31st). 6:30 executes the LS command once. ]
Every day 7:50 executes all executables in the/etc/cron.daily directory as root
7 * * * Root run-parts/etc/cron.daily [Note: The Run-parts parameter indicates that all executables in the following directory are executed. ]
Linux timed Task Crontab