1
votes

I want to set up a cron job. The job has to run every 2 days at 1100 hours. The constraint being our server restarts once every day (non negotiable). What should my cron expression be? I don't think this expression will hold good :

<property name="cronExpression" value="0 0 11 1/2 * ?" />

Any suggestions?

1

1 Answers

0
votes

If you want your cron job to be persisted in the store for re-use after program restarts, set volatility of your cron job to TRUE.

In code it should look like this:

//Some code

JobDetail job = new JobDetail(JOBNAME, GROUPNAME, CRONJOB.class);
job.setVolatility(true);
scheduler.scheduleJob(job, trigger);
scheduler.start();

// Some code