Something I work with all the time, is a “file wait” need to kick off ETL processes especially conditionally from an ETL tool. I’ve always used a conditional file-wait method, and just wanted to share this with you.
Here is a Windows BATCH file Script that will wait conditionally for a file to “appear”, and will exit based on two different conditions:
@if exist %3 (
@Set /A Runtry+=1
@if %Runtry% lss %2 goto :START
@echo %runtry% exiting
the file should be called: CHECK.BAT
So: CHECK 30 5 MyFile.txt
will wait 30 seconds between “checking”, and will check for the file 5 times, then exit.
The Exit(0) is success, and the exit(-1) is the failure condition.
I hope you find this helpful.