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.