• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Cron expression issue

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might get more responses in the Linux forum, moving.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic