Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Scheduled script stops working randomly

Thanks for the update. I'll put some monitoring in to confirm I get exit code 3, and meanwhile +1 for the bug fix...

Scheduled script stops working randomly

We've been using WinSCP successfully for several months with one frustrating issue. I have a very simple batch file that calls a WinSCP script and then makes a CURL request. This is scheduled to run very frequently (once per minute). This is run by Task Scheduler using my domain account. /script="script.txt" /log="FtpLogs/%date:~6,4%-%date:~3,2%-%date:~0,2%.txt" > ScriptOutput.txt

CURL -o CurlOutput.html -k

Everything works perfectly for days and then, apparently randomly, the WinSCP script stops working - ScriptOutput.txt is empty and there is nothing appended to the log file. I can see that the batch file is executing fine, because the CURL request is still firing (so doesn't seem to be an issue with the scheduler). Also, if I run the batch file interactively everything works as expected (so also not apparently an issue with my domain user). However, the script just won't work when called from the scheduler.

The only thing I've found that resolves this is restarting the server.

Has anyone encountered this/got any advice?