Hi - I am trying to run the following command in the Execute Command Action option but it always hangs on the following command. The idea is to get the Scheduler to sit in a loop and wait for a file to exist. if the file does not exist I want to pause for 1 minute and then check again. However stripping the code down and testing each line it is the sleep function that does not work:-
choice /c 1 /d 1 /t 60 >nul
Any other ideas on how to fix this or how I can make it wait for a file to exist? Regards, Neil
Hi Neil, You could use the watch folder to do this "http://www.visokio.com/kb/watch-folder". This means that all your clients files should come with an XML action descriptor file that describes what the scheduler should do. This is the easiest approach to do this and you do not have to write commands. Please let me know if this solution suffices.
Hi Mohamed We are doing this at the moment but there are 2 reasons we wanted to do this. The other one is to use this to find out when a job has finished on the scheduler. For example we have one big job that runs then we want to be able to run about 5-10 other jobs using the fork execution at the same time when this first job is done. I know we can add these all to the same schedule but we want to get the data out faster than that, plus if one fails at the top the rest of the jobs don't run. We don't want these jobs to kick off until the first is done. I know I can do it with the watch folder, I just think it will be tidier using a script and getting the job to wait until the trigger is ready. Rather than coping 10 xml's over in one go. Will the watch folder run 10 jobs at once if 10 xml's are dropped in the folder at the same time and fork is on? Regards Neil
Hi Neil, The following batch file checks for any IOK files in a specific directory. If there is no IOK file it will keep checking, until an IOK file is found.
The batch file is as follows:
" :LoopStart IF EXIST "C:\Users\[User home]\Batch\*.iok" GOTO LoopEnd echo 'sleeping for 2 secs' sleep 2 GOTO LoopStart :LoopEnd REM You're out of the loop now echo 'File exists' " Please configure the scheduler Execute command action to execute the above batch file.
The following tasks will only execute if an IOK file exists in the given directory.
Hi Mohamed I have tried every single one of those, either now or on other site I found before and none seem to work. Its as if the Scheduler doesn't like anything that waits. Its odd that it doesn't like the ping one as they does not wait! Regards, Neil