With Crontab you can execute a shell script or a series of Linux commands at a specified time. For example, the system administrator schedules a backup task to run every day
Entry
# crontab–e
This allows you to open your personal crontab profile in edit mode and then add this line:
0 0 * * */home/linrui/xxxxxxxx.sh
This will run the specified. sh file in the wee hours of the day
Cron description of each item
The following is the format of the crontab file:
{minute} {Hour} {Day-of-month} {Month} {Day-of-week} {Full-path-to-shell-script}
O minute: Interval is 0–59
O Hour: Interval is 0–23
O Day-of-month: Interval is 0–31
O Month: The interval is 1–12. 1 was January. 12 was December.
O Day-of-week: Interval is 0–7. Sunday can be 0 or 7.
Crontab Example
1. Run at 00:01
1 0 * * */home/linrui/xxxx.sh
2, the backup job every weekday 23:59.
* * 1,2,3,4,5/home/linrui/xxxx.sh
or the following:
* * 1-5/home/linrui/xxxx.sh
3. Run a command every minute
*/1 * * * */home/linrui/xxxx.sh
4, 1th number 14:10 per month to run
1 * */home/linrui/xxxx.sh
Crontab Options for Commands
The following are the valid options for crontab:
Crontab–e: Modify the crontab file. If the file does not exist, it is created automatically.
Crontab–l: Displays the crontab file.
Crontab-r: Delete the crontab file.
Crontab-ir: Alerts the user before deleting the crontab file.
Free pick up brother even it education original Linux OPS engineer video/Detailed Linux tutorials, details Inquiry official website customer Service: http://www.itxdl.cn/linux/
Learn PHP, Linux, HTML5, UI, Android and other video tutorials (Courseware + notes + video)! Contact Q2430675018
Linux Communication Group Welcome to group number: 478068715
Crontab let Linux execute shell scripts at timed intervals