Use crontab scheduling java application problem occurs
- by koma
The main method to start the java application. The main method initialize the log, and then determine whether the process is running.
Every 10 minutes, scheduled to run through the linux crontab. Able to determine that the 10 minutes of this program must end.
Under normal circumstances, will print the following log
The beginning of the implementation of 10 minutes
The end of the 10 minutes of normal
The beginning of the implementation of 20 minutes
The end of the 20 minutes of normal
The beginning of the implementation of 30 minutes
The end of the 30 minutes of normal
.....
But now this situation:
The beginning of the implementation of 10 minutes
The end of the 10 minutes of normal
Execution starts in 30 minutes, but detected already have a process in operation, the program exits.
Start the execution of 40 points, but detected already have a process in operation, the program exits.
.....
Very strange 20-minute log does not print, but the 20-minute program has been launched by the ps-ef | grep java view java thread, found in a 20-minute thread is locked. But why not see the log
Check the linux dispatch log, not see scheduling a 20-minute log.