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:You can use patterns like
!Y-!M-!D-!T-!P
to make the filename unique.See https://winscp.net/eng/docs/ui_pref_logging#session_log