Watch for a File - Notify if not found within certain timeframe - VisualCron - Forum

Community forum

bbusse
2013-04-05T14:23:46Z
On our old scheduler that we're moving away from, we're still running VisualCron 4.6.17 and we have a couple of our jobs that were custom written VB Scripts due to a requirement we have that i couldn't come up with a solution to within VisualCron. I am not sure this capability exists today withi 6.2.1 either, so I figured maybe its about time to ask, right? :)

I might just be tired, I haven't given these processes much thought in the last year or so, but since i'm migrating stuff to the new server on 6.2.x I figured i'd rethink it if possible.

We need to notice when a file shows up which i realize a file trigger will do... and then submit it using our Connect:Direct NDM process. This in itself is simple, however the notification piece is where I'm hung up.

The Business Unit doesn't just want an e-mail when the file is found and the submission takes place. They also want to know if the file never showed up to trigger the job. So... this one job's VB Script runs at 4:30am and does a check for a 'trigger file', if it doesn't exist, it sleeps for a few minutes, and then checks again. This loop has a maximum retry of X times (couple of them are 24 times, some are 36, etc...) so if at the end of the maximum retry count it it has not found the file it was waiting for, it'll send a failure notification. If it DID find the file, it'd submit the NDM process and then quit the script. These retry counts are based on the math that would allow it to send a failure by 8am or whatever time the BU wanted, so they'd know to go investigate why the file wasn't generated.


Got any automagic ways I could accomplish this using native functions/tasks in VC?


Simplified requirements that aren't so wordy:

1. File should show up between 4:30am and 8:00am.

2. If the file shows up, Submit NDM process and send e-mail with Start notification.
2a. Do not trigger again 'today', this is a once-per-day submission.

3. If file did not show up by 8:00am, send e-mail stating 'not found' to the Business Unit.


Sounds simple, and maybe it is, but I can't think of a way to cleanly accomplish this.

The way things are now, i am guessing i'd have to use 2 jobs. One to do a file trigger that updates a variable if it actually ran. Then another job that runs at the time they need to know it hasn't showed up yet.... and check the variable. If its not created or says 'not_ran' or something, send the failure.

Brian
Support
2013-04-08T10:34:57Z
Right now, only good way I see, is to use the Touch file Task in the Trigger Job. Then you can schedule a separate Job using the List files Task along with a date filter on that Task. If file is found (older than your max date/time) then do what you want to do, maybe notify etc.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Jordan K
2017-09-22T16:18:45Z
So four years later...is there a more "automagical" way to accomplish this now?
Support
2017-09-25T08:11:55Z
Originally Posted by: Jordan K 

So four years later...is there a more "automagical" way to accomplish this now?



No automagical. You should schedule with a time trigger and use the List files Task to check for a file of a certain age. If no file is found you could do something.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top