Paste:
http://blog.csdn.net/allenlinrui/article/details/7490206
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
Getting Started
# crontab–e
This allows you to open a personal crontab profile in edit mode, and then join this line:
0 0 * * */home/linrui/xxxxxxxx.sh
This will run the specified. sh file in the wee hours of the day.
Description of Cron items
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 is January. 12 is December.
o Day-of-week: The interval is range 0–7. Sunday can be 0 or 7.
Crontab Sample
1. Run at 00:01
1 0 * * */home/linrui/xxxx.sh
2. Backup jobs are performed every weekday 11:59.
1,2,3,4,5/HOME/LINRUI/XXXX.SH * * * *
Or the following wording:
1-5 * * * */home/linrui/xxxx.sh
3. Run one command per minute
*/1 * * * */home/linrui/xxxx.sh
4.1th # 14:10 per month run
1 * */home/linrui/xxxx.sh
options for the crontab command
The following are 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: Deletes the crontab file.
Crontab-ir: Remind users before deleting crontab files.