@Scheduled (cron = "0 5 * * *?")
Org.springframework.scheduling.annotation.Scheduled
/** * Annotation that marks a method to be Scheduled. Exactly one of the * <CODE>CRON</CODE>, <code>fixeddelay</code>, or <code>fixedrate</ code> * attributes must be provided. * * <p>the Annotated method must expect no arguments and has a * <code>void</code> return type. * * <p>processing of { @code @link Scheduledannotationbeanpostprocessor}. This can is * do manually or, more conveniently, through the { @code <task:annotation-driven/>} * element or @{ @link enablescheduling} annotation. *
Try with: @Scheduled (cron= "0 1 1 * *?"Here is Some example pattern found on spring forum:* "0 0 * * * *" =The top of every hour of every day.* "*/10 * * * * *" =every ten seconds.* "0 0 8-10 * * *" = 8, 9 and ten o ' clock of every day.* "0 0/30 8-10 * * *" = 8:00am, 8:30am, 9:00am, 9:30am and ten o ' clock every Day.* "0 0 9-17 * * mon-fri" = on the Hour nine-to-Five weekdays* "0 0 0 25 12?" =every Christmas day at Midnightcron expression was represented by six fields:second, minute, hour, day of month, month , day (s) of week (*) means match any*/x means "every X"? ("No specific value")-useful when you need to specify something in one of the the the and the the in which the character are allow Ed, but isn't the other. For example,ifI want my trigger to fire in a particular day of the month (say, the 10th), and But don ' t care what's Day of the week that Happe NS to IS, I would put "ten" in the Day-of-month field, and "?" in the Day-of-week field.ps:in order to do it works, remember to enable it in your application context:http://docs.spring.io/autorepo/docs/spring-framework/current/spring-framework-reference/html/scheduling.html# Scheduling-annotation-support
Reference
http://stackoverflow.com/questions/26147044/spring-cron-expression-for-every-day-101am
Spring @Scheduled Usage