Differences

This shows you the differences between the selected revisions of the page.

2017-01-07 2018-02-01
explicit anchor use (martin) Inspecting Output Log (martin)
Line 17: Line 17:
If the problem is not obvious from the output, enable logging to a file as described below. If the problem is not obvious from the output, enable logging to a file as described below.
-===== Inspecting Log =====+===== Inspecting Session Log =====
Next step is to enable logging to file (you should have logging enabled anyway) and inspect the log. Use ''[[commandline#logging|/log]]'' command-line parameter. Next step is to enable logging to file (you should have logging enabled anyway) and inspect the log. Use ''[[commandline#logging|/log]]'' command-line parameter.
Line 33: Line 33:
If you know that the task failed with [[scripting#result|exit code 1]], see [[faq_exit_code|Why is WinSCP returning non zero exit code?]] to learn what to look for in the log. If you know that the task failed with [[scripting#result|exit code 1]], see [[faq_exit_code|Why is WinSCP returning non zero exit code?]] to learn what to look for in the log.
 +
 +===== [[output]] Inspecting Output Log =====
 +If a session log file is not even created, when executed from Windows Scheduler/%%SSIS%%, although the same WinSCP command and logging is working, when executed manually  on command-line, there can be some problem in the Windows Scheduler/%%SSIS%% environment that prevents WinSCP from starting or writing to the log.
 +
 +To debug such problems, wrap WinSCP command to a batch file and redirect WinSCP console output to a file. Make sure you use a console interface tool ''[[executables|winscp.com]]'', instead of ''winscp.exe''. It also useful to log something to the output file before running WinSCP, to verify that output logging is working.
 +
 +The batch file can look like:
 +
 +<code batch>
 +@echo off
 +echo Starting WinSCP > C:\script\example.out
 +"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="c:\script\example.txt" /log="c:\script\example.log" >> C:\script\example.out
 +echo WinSCP done >> C:\script\example.out
 +</code>
 +
 +Make sure you use a path for the ''example.out'', where Windows Scheduler/%%SSIS%% have a write access to. Check an output logged to ''example.out'' for any problems. If the ''example.out'' is not even created, the problem is not with WinSCP.
===== Further Reading ===== ===== Further Reading =====

Last modified: by martin