Timed Run command scripts in Linux
Crontab
The crontab command is used to install, delete, or list tables used to drive the cron daemon, and the user places the sequence of commands that need to be executed in the crontab file for execution.
Each user can have their own crontab file,/var/spool/cron under the crontab file can not be directly created or directly modified, the Crontab file is created by the CRONTAB-E command
In the crontab file, how to enter the command and time to execute, each row in the file contains six fields, the first five of which are the time the specified command was executed, and the last field is the command to be executed.
Spaces or tabs are used to separate each field. The format is as follows:
Minutehour day-of-month month-of-year Day-of-week commands
Legal value 00-59 00-23 01-31 01-12 0-6 (0 is Sunday)
In addition to the numbers there are a few special symbols that are "*", "/" and "-", ",", * representing all the values within the range of numbers
"/" stands for each meaning, "/5" means every 5 units, "-" stands for a number of discrete numbers from a certain number to a digit, ",".
-L Displays the current crontab on the standard output.
-R Deletes the current crontab file.
-e Edit the current crontab file using the editor referred to in visual or editor environment variables. When you finish editing, the edited file is automatically installed.
Example:
Six points per day:
0 6 * * command
Every two hours:
0 */2 * * command
11 o'clock to 8 a.m. every two hours and eight a.m..
0 23-7/2,8 * * command
Every month, number 4th and Monday to Sunday, three a.m., 11.
0 4 * 1-3 command
January 1 morning, 4.
0 4 1 1 * command
Every day 4 o'clock in the afternoon, 5, 6 points of 5 min, min, min, min, min, min, when the execution of orders.
5,15,25,35,45,55 16,17,18 * * command
Execute this command with crontab
Crontab Scheduled Tasks