WinSCP - How to recognize if file was transferred successfully

前端 未结 3 1373
逝去的感伤
逝去的感伤 2021-01-16 04:33

I\'m using WinSCP to automatically upload files through SFTP. I have turned on debug log on level 1. Is it possible to find out if the file was uploaded successfully? Thank

3条回答
  •  抹茶落季
    2021-01-16 04:37

    Quoting WinSCP FAQ How do I know that script completed successfully?:

    You can tell the result of script by WinSCP exit code. Code 0 indicates success, while 1 indicates an error. For more details refer to scripting documentation.

    Batch script (specified using /script or /command command-line switches) terminates with code 1 immediately once any error occurs. You can change this using option batch command.

    To find out why the script failed, inspect session log.

    For an example see a guide to transfer automation or the example on retrying s/connection attempt.

    If you need a better control of error handling, consider using WinSCP .NET assembly instead (e.g. from a PowerShell script).

提交回复
热议问题