Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Facing problem for building cron expression daily for every N days  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am facing problem in building cron expression for below pattern.

Daily for every three days starting on nov 09, no end date
cron expression: 0 0 0 09/3 * ? *
output is 9th,12th,15th.....

Above expression working fine before last week of month.

If i try the same expression for this paatern every three days starting on 29 nov, no end date
cron expression: 0 0 0 29/3 * ? *
output 29th nov,29th dec,29th jan, 29th mar

Can some body help me in build expreesion for handling above 2 cases.

Thanks,
Prasuna.
 
Sheriff
Posts: 23965
50
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time I look at cron documentation, I see there's two kinds of day: there's Day-Of-Month and there's Day-Of-Week. You're experimenting with Day-Of-Month and now you have found how it behaves. Notice the "Of-Month" part in the description, that explains why it behaves that way.

If that isn't clear, then let me put it this way: from the cron documentation I have read, I wouldn't expect to be able to produce an expression which meant "every three days regardless of month boundaries".
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!