Quick notes on using jcrontab
Simple scheduler providing crond like features.
Steps to use jcrontab
- Add the following declaration in web.xml
<servlet>
<servlet-name>JCrontabLoaderServlet</servlet-name>
<servlet-class>org.jcrontab.web.loadCrontabServletCL</servlet-class>
<!-- can overwrite the parameters from jcrontab.properties -->
<!-- simply adding here the right parameters -->
<init-param>
<param-name>org.jcrontab.data.file</param-name>
<param-value>crontab</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>- Put the jcrontab.properties in WEB-INF/classes/
- Put the crontab in WEB-INF/classes/
Format for the crontab
The time format of crontab is exactly the same as Unix crontab. The job part is a fully qualified class name (eg: org.someproject.MyJob)
So the following line will instruct JCrontab to start MyJob every 3 minutes.
*/3 * * * * org.someproject.MyJob