Scheduler timing

Hi All,

I got a requirement to run a scduled service every last day of the month, any clues how to achieve this?

Regards
sandeep

I suggest you may need three scheduler tasks:

1> 31 Jan, Mar, May, Jul, Aug, Oct, Dec
2> 30 Apr, Jun, Sep, Nov
3> 28 Feb and also check for (29 Feb in a leap year)

What is your approach on this? Can you share to assist you better.

Hi Sandeep,

You better write a Unx Shell Script, using this single one you can easily meet your requirement. Kindly let me know if you face any issues in designing.

Thanks,

So you suggest create a unix script and call from IS via command line execution and schedule this service to run periodically and based on the script result flag it?

Can you elaborate design a bit more for the users if possible?

I am sure this can be done via OS script or custom JS logic.

HTH,
RMG

Why don’t we write a wrapper service which checks if today is the last day of the month and then execute the service.
And then schedule the wrapper service everyday??

Calendar cal = Calendar.getInstance();
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
Date lastDayOfMonth = cal.getTime();

get this date and compare it with today’s date and then branch .

1 Like

Hi RMG,

Here you go with it:

Use Developer to generate a java application that will invoke your service from the command line and then code your script to do so.

In Developer, go to Tools->Generate Code->For calling this service from a client->Java.

And in shell script you follow below one:

#!bin/sh
path/to/java test

where test is the name of java class.

Please try to implement and let us know if any hinderances.

Thanks,

1 Like