The syntax of crontab
in each of these fields, you can also use the following special characters :
asterisk (*): represents all possible values, such as the month field if it is an asterisk, the command action is executed monthly after the constraints of other fields are met.
comma (,): You can specify a list range with a comma-separated value, for example, "1,2,5,7,8,9"
Middle Bar (-): An integer range can be represented by a middle bar between integers, such as "2-6" for "2,3,4,5,6"
Forward slash (/): You can specify the interval frequency of the time with a forward slash, such as "0-23/2", which is performed every two hours. A forward slash can be used with asterisks, such as */10, if used in the minute field, which means that it executes every 10 minutes.
Here are some of the timing tasks I have encountered:
The first is also crontab-e as follows:
0 6 * * */data/ftp/ftp001/my/sh/cac.sh >/data/ftp/ftp001/qiangzhan/sh/log/cac.log, will be automatically executed, no problem.
/data/ftp/ftp001/my/sh/cac.sh in the cac.sh implementation is the Java program, vi cac.sh content as follows: JAVA-XMS2048M-XMX4096M-CP.: Mysql-connector-java-5.1.26-bin.jar:data.jar Cmge. Appmain 2015/01/02. Running cac.sh alone is OK, but the Java program is not run with crontab execution.
READ: crontab Unable to get JDK variables, to write to the JDK absolute path before the Java command, and to switch to the SH path to be executed, I this problem these two conditions are indispensable. Modify the cac.sh to:
cd/data/ftp/ftp001/my/sh/
/usr/lib/jvm/jdk1.7.0_71/bin/ java-xms2048m-xmx4096m-cp.: Mysql-connector-java-5.1.26-bin.jar:data.jar cmge. Appmain 2015/01/02
Linux under Crontab timed Java program execution, Java program does not perform the problem