• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic