It said so many common commands, there is a function we also often use, is the timer, schedule, generally through the crontab to run;crontab specifies that specific scripts are executed at fixed or fixed intervals; crontab has the following 3 common parameters:
-E: Executes the text editor to set the schedule, the general default editor is VI;
-R: Delete all current schedules;
-L: Lists all current schedules;
To set the schedule, you need to have a fixed format, a total of 6 parts, with space between the sections, the 6th part is the command to execute, the first 5 parts are set execution time or time interval, the specific value range and meaning are as follows:
Minutes "0-59" hours "0-23" Day "1-31" month "1-12" Week "0-6"
There are 4 ways to specify each item at the time of Setup, as follows:
*: Indicates that every minute of/.../week needs to be executed;
A-B: indicates that the period from/.../week to/.../week of the first minute should be enforced;
*/n: Indicates that every n minutes/.../week interval is executed once;
A,b,c: Indicates that a,b,c minute/.../week is required to execute, that is, specify more than one specific point in time;
For example, for example, to specify that the crontab setting of the script Mysh every morning 7 is as follows:
0 7 * * */home/admin/mysh >/home/admin/mylog.txt 2>&1
One of the redirection symbols, 2>&1 and other representatives of the meaning can be see Http://blog.csdn.net/sfdev/archive/2008/07/29/2729680.aspx;
The Java Timing Framework Quartz also supports a timing scheduling policy configuration similar to Crontab, and is configured almost exactly the same way, as described in the following:
Http://blog.csdn.net/sfdev/archive/2009/03/02/3950640.aspx
Original
http://blog.csdn.net/sfdev/article/details/4025916