I have a script that runs every 10 minutes. It downloads some files using command
There are normally one to 3 files fitting that pattern.
Today, we had a situation where there were two files on the FTP site that fit that pattern and the first downloaded properly but the second failed to download. I have the log file from this situation, but it's not really what I need help on. The batch file failed with an error per
if %ERRORLEVEL% neq 0 goto error
exit 0
:error
exit 1
When it ran again 10 minutes later, there were three files that matched the pattern. The first successfully downloaded, the second failed to download, and the third successfully downloaded. The batch file did not fail. I didn't save the log file from this instance. The log files are emailed to me when the batch fails, but of course since the batch didn't fail nothing was emailed to me. I let it get overwritten after I looked at it.
Is there something I can do to make the batch job fail if any file fails to download?