0

I am developing java application and in this I wanted to run some method periodically. I have used java schedule to run that method periodically. This is my Cron Expression.

/* runs in twelth second by every 5 minutes*/   
public static String CRON_TIME = "12 0/5 * * * ?";

This works fine. Now I wanted to stop running this scheduler for one hour per day. How I can write Cron Expression to do it? Give me a idea.

Draken
  • 3,134
  • 13
  • 34
  • 54
Pradeep Gamage
  • 585
  • 4
  • 8
  • 21

1 Answers1

0

If you want to exclude between 01:00 and 02:00 then use:

"12 0/5 0,2-23 * * ?"
Draken
  • 3,134
  • 13
  • 34
  • 54
Nirmal- thInk beYond
  • 11,847
  • 8
  • 35
  • 46