File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cron expression issue

 
Amol Fuke
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have a cron job scheduled to run at every hour ;



Suppose I have created another job at 3:38 PM, will it run at 4 PM/5 PM/6 PM or 4:38 PM/5:38 PM/6:38 PM ?

Another question , what would be the cron expression if I want to run the job every hours in besiness hours i.e. between 7 AM to 7 PM.

is this right "0 0 7-19 ? * *" .But sometimes the jobs gets fired after 19 hours also.

Please let me know.

Thanks,
Amol
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might get more responses in the Linux forum, moving.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:You might get more responses in the Linux forum, moving.

Not sure this is a unix cron here. I don't think that unix cron has a setting for seconds. It should have only 5 fields, not 6.

Amol, where are you setting this expression ?
 
Justin Yao
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amol Fuke wrote:Hi ,

I have a cron job scheduled to run at every hour ;



Suppose I have created another job at 3:38 PM, will it run at 4 PM/5 PM/6 PM or 4:38 PM/5:38 PM/6:38 PM ?

Another question , what would be the cron expression if I want to run the job every hours in besiness hours i.e. between 7 AM to 7 PM.

is this right "0 0 7-19 ? * *" .But sometimes the jobs gets fired after 19 hours also.

Please let me know.

Thanks,
Amol



The fields of crontab expression
minutes hours day_of_month month day_of_week


If I want to run the job every hours in besiness hours, should be like this
0 9-18 * * 1-5
it will run every hour between 9AM to 6 PM from Monday to Friday
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic