Hi have a WinSCP script to put a file on remote server using SFTP, which is working fine. But I would enable logging to a text file on a local directory.
I have the following script
option batch on
option confirm off
# connect minute session
open sftp://xyz.com:22/ -privatekey=E:\PK\*.ppk
# force binary mode transfer
option transfer ascii
# navigate to mediacom and put file
lcd "E:\export\"
cd /mediacom/testdir
put "CI_Tst.tab"
# disconnect daily session
close
# exit WinScP
exit
Many I know how I can log results of above script to a local file?
To enable logging, use the /log=
command-line switch of WinSCP:
winscp.com /script=C:\path\to\script.txt /log=C:\path\to\script.log
来源:https://stackoverflow.com/questions/41304915/enabling-text-file-logging-for-winscp-script