Need tricky Interval Time Triggers for job Main Settings - VisualCron - Forum

Community forum

DickChap
2014-10-08T22:38:46Z
I am running a job that downloads and processes billing related files. It needs to run every Friday, AND it needs to run on the 2nd of the month (to pick up all end of month data). HOWEVER, since no files are available over the weekend, it needs to run on the 3rd or 4th if the 2nd falls on a weekend.

Is there any way in VisualCron to set up triggers to do this? The standard or customer triggers don't seem to allow for combined conditions (like 2nd of the month AND first weekday). For dependent triggers to work, it looks like they would both have to be true. But if I make 2nd of the month and first weekday triggers dependent, I can't also make 3rd of the month and first weekday triggers dependent at the same time (apparently, based on the GUI).

Basically I need a trigger for first weekday of the month which falls on or after the 2nd day of the month. Perhaps one trigger which runs on the 2nd, 3rd, and 4th of the month which is dependent on a trigger for the first weekday of the month?

This brings up another question. Before I was using triggers for Friday and the 2nd of the month which fired at the same time, so the job tried to run twice at the same time. Is there a way to indicate a job should not start if it's already running?

Thanks,
- Dick

Support
2014-10-09T07:53:39Z
Not directly supported (this kind of logic). Why not use a File Trigger and send the file instantly when it becomes available?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
al355
2014-10-09T09:19:38Z
I think this could be done using holidays as exclusions
DickChap
2014-10-10T15:29:16Z
Using a File Trigger doesn't really fit my situation. I have my own ftp utility (w/ many feature) I used for ftp downloads. I don't know if a file is there until the first task has executed. I'm looking or job level triggers.

Luckily my job runs OK if these is no file. So I ended up using three triggers: Fri. at 7:30 AM, 2nd of the month at 8 AM, and first workday of the month at 7:30 AM. If the 2nd is on a weekend, there will be no file anyway. If the 2nd falls on a Friday, the 7:30 job would have already run and these would be no file anyway.

I will sometimes do an extra run on the first workday of the month. This is fine, but not exactly perfect control.

BTW... Considered using exclusions, but from the Help this didn't seem appropriate for "all weekends". Will check into this a bit further.
skepticbelief
2014-10-10T21:25:10Z
I'll respond to the second question first. If you are using multiple triggers for a job, you might want to consider using the "Do not run job if it's running" option or "Put Job in Queue" option available on the main settings tab of the edit job window.

For you primary question, here is what I would do:

1) set a time trigger to run the job every weekday
2) create a condition set "Friday" and set the actions (Match all: don't wait, continue. All others: don't wait, exit)
3) add the conditions as you need using variables
3a) if today = Friday (doesn't litterally work this way but you get the gist)
4) create a condition set "End of Month" and set the actions (Match all: don't wait, continue. All others: don't wait, exit)
5) add the conditions as you need using variables
5a) if day of month = 2
5b) if day of week != Sunday
5b) if day of week != Saturday
6) create a condition set "End of Month part 2" and set the actions (Match all: don't wait, continue. All others: don't wait, exit)
7) add the conditions as you need using variables
7a) if day of month < 4
7b) if day of week = Monday

The combination of triggers, conditions, and variables makes almost anything possible.

Cheers
Scroll to Top