Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


MSchwartz
2021-04-21T20:18:47Z
We receive a file from a client at 10pm every night. We want to delay execution of the job that processes these files until 5am the next day (7 hours).

There are two ways we've tried to accomplish this, and both of them have drawbacks we want to avoid:

1. If we use a file trigger, the job will trigger and run at 10pm. If we want to delay until 5am, we would need to set a Wait task for 7 hours. This isn't ideal because if, for example, the server is rebooted at any time during those 7 hours, the job stops and the processing tasks will not run.
2. If we use a time trigger, the job will run on all files that exist in the folder at the specified time. Rarely, the client will drop two files, and since our process expects only one file, the job fails.

I don't believe time exceptions are what I'm looking for because, from my understanding, they will cause the job to simply not run when the job is triggered.

I have considered having both a time and a file trigger and using a dependency to evaluate the triggers together, but I'm not 100% sure how to set that up correctly.
Sponsor
Forum information
Joey S
2021-04-21T21:56:21Z
All I can think that you can do is this

https://www.visualcron.c....aspx?g=posts&t=2463 

Have two jobs. Job 1 is triggered by the file
Task 1 would be to set the schedule for Job 2 (using the method in the post above)

Job 2 would be to run your process. Maybe have the first task be send an email and/or check for the number of files in the folder if that can make it fail

thomas
2021-04-22T08:38:54Z
You want the job to run at 5 am every day. To me that is a time trigger, pretty much by definition. I would change the job to be able to handle multiple files. If this is something you don't want to do for whatever reason, you could solve it by creating a second job:

Let's say your existing job is called ImportFile and it can handle only one file at the time. Create a new job, let's say GetFiles. This job runs at 05 am, it fetches and lists all the files that it found. It loops over these files and calls job ImportFile, passing in the filename as parameter. This way you will only have to make minor changes to you original job.

Support
2021-04-22T12:42:03Z
Originally Posted by: MSchwartz 

We receive a file from a client at 10pm every night. We want to delay execution of the job that processes these files until 5am the next day (7 hours).

There are two ways we've tried to accomplish this, and both of them have drawbacks we want to avoid:

1. If we use a file trigger, the job will trigger and run at 10pm. If we want to delay until 5am, we would need to set a Wait task for 7 hours. This isn't ideal because if, for example, the server is rebooted at any time during those 7 hours, the job stops and the processing tasks will not run.
2. If we use a time trigger, the job will run on all files that exist in the folder at the specified time. Rarely, the client will drop two files, and since our process expects only one file, the job fails.

I don't believe time exceptions are what I'm looking for because, from my understanding, they will cause the job to simply not run when the job is triggered.

I have considered having both a time and a file trigger and using a dependency to evaluate the triggers together, but I'm not 100% sure how to set that up correctly.



You've gotten some great suggestions from Thomas and Joey, did you get it working? If not, let us know
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Scroll to Top