I have several scheduled tasks running FME workspaces from the Windows cmd environment. I determine whether the run was successful by checking fme.exe's return code, which is 0 on successful runs.
This usually works but on rare occasions fme.exe immediately spits out the value "2", and produces no log file at all. I'm unable to reproduce this, but out of ~80 jobs running daily it happens a couple of times a week. My main questions/concerns are: 1. What are the troubleshooting steps for this? and 2. How can I make FME write a log file when this error occurs?
This is how I'm calling FME:
for %%i in (*.fmw) do (
fme %%i
if !errorlevel! neq 0 (
echo "The FME errorlevel was !errorlevel!" >> debug.txt
)
)