JobRunr Pro

Advanced CRON expressions

The advanced CRON expression parser of JobRunr Pro supports your most difficult scheduling requirements.

JobRunr Pro has support for more difficult CRON expressions.

See some examples below:

BackgroundJob.scheduleRecurrently(Cron.firstDayOfTheMonth(10, 30), () -> System.out.println("First day of the month!")); 
This will run at 10:30 am on the first day of the month.
BackgroundJob.scheduleRecurrently(Cron.firstBusinessDayOfTheMonth(10, 30), () -> System.out.println("First business day of the month!")); 
This will run at 10:30 am on the first business day of the month, even if the first day of the month is a Saturday or a Sunday
BackgroundJob.scheduleRecurrently(Cron.lastDayOfTheMonth(10), () -> System.out.println("Last day of the month!")); 
This will run at 10:00 am on the last day of the month
BackgroundJob.scheduleRecurrently(Cron.lastBusinessDayOfTheMonth(10, 30), () -> System.out.println("Last business day of the month!")); 
This will run at 10:30 am on the last business day of the month, even if the last day of the month is a Saturday or Sunday

Advanced CRON example

You can also create some more fancier CRON expressions like:

BackgroundJob.scheduleRecurrently("0 0 LW-3 * *", () -> System.out.println("Three days before the business day of the month!")); 
This will run at midnight three days before the last business day of the month