Use crontab scheduling java application problem occurs

Posted by koma on Ask Ubuntu See other posts from Ask Ubuntu or by koma
Published on 2012-10-09T03:13:46Z Indexed on 2012/10/09 3:50 UTC
Read the original article Hit count: 227

Filed under:
|

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.

© Ask Ubuntu or respective owner

Related posts about java

Related posts about cron