File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Need to run a schedule task only once in betweeen mentioned hours.
Joined: Sep 21, 2009
Jan 22, 2014 08:09:42
I need to run a schedule task only once in betweeen mentioned hours.
For the below configuration My service class method transferLookUpData() is executing for every one minute daily.
<task:scheduled ref="transferScheduler" method="transferLookUpData" cron=" 0 0/1 * 1/1 * ?"/>
Now I try to run this daily once between 9pm to 12pm. To acheive this i tried
<task:scheduled ref="transferScheduler" method="transferLookUpData" cron=" * * 21-24 * * ? "/>
But even the server time not between 21hr - 24hr it is executing. More over I need to run this scheduler only once in between 21hr and 24hr.
Please suggest the cron format for this.
Joined: Jul 04, 2006
Jan 22, 2014 09:18:09
Only 0-23 are allowed for hour. Please try 21-23 and see if it works.
I agree. Here's the link:
subject: Need to run a schedule task only once in betweeen mentioned hours.
use cron in spring 2.5
can we notify if scheduler task not running at given time intervals
Cron expression with Spring Task scheduler
Simple Spring Batch
Dynamically adding/removing task in Scheduled Task
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015