Enabling text file logging for WinSCP script

泪湿孤枕 提交于 2019-12-08 03:29:42

问题


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?


回答1:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!