wood burning stoves 2.0*
The moose likes Java in General and the fly likes help on cron expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "help on cron expression" Watch "help on cron expression" New topic
Author

help on cron expression

vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
Hello,

I need help on writing a cron expression that will fire at 3 days before the last day of each month. Which means, if the last day is 31st, it will fire at 28th. And if the last day is 28th, it will fire at 25th.

the following does not work at all:
0 0 1 L-3 * *


I'm not available, my BF's name is WORK.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Did you try searching for "cron tutorial" with Google? This is what I found:

Newbie: Intro to cron
Cron Tutorial
Cron Tutorial. Cron, the linux event scheduler

etc.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
I tried, but they are normally done using intervals, which I think in my case, is impossible

if I want to do the same thing, but trying to check whether current date is 3 days before the last day of month in Java, how can I do that?
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
btw... something is wrong with my browser and it's causing multiple threads here, can Admin please help me lock the extras up? Thanks!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

To find out if it is 3 days before the end of the month in Java, you could use the methods in java.util.Calendar.
 
Don't get me started about those stupid light bulbs.
 
subject: help on cron expression
 
Similar Threads
Facing problem for building cron expression daily for every N days
help on cron expression
help on cron expression
Generating Cron Expression
Calendar, recurring events how to store ?