2016-12-23 164 views
1

嗨有一個WinSCP腳本來使用SFTP將文件放在遠程服務器上,它工作正常。但我會啓用日誌記錄到本地目錄上的文本文件。啓用WinSCP腳本的文本文件日誌記錄

我有以下腳本

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 

很多,我知道我怎麼可以登錄以上腳本的結果到本地文件?

回答

1

要啓用日誌記錄,使用WinSCP賦予的/log= command-line開關:

winscp.com /script=C:\path\to\script.txt /log=C:\path\to\script.log 
+0

這可以限制登錄,只有當腳本失敗? – DoIt

+0

不,但您可以創建一個包裝器批處理文件,用於刪除成功登錄。 –

+0

Thanks.Is是否有可能爲每次運行創建一個新的日誌文件? – DoIt