Can we save the execution log when we run a command using PuTTY/Plink

前端 未结 2 1613
夕颜
夕颜 2021-01-16 04:11

I am using Plink to run a command on remote machine. In order to fully automate the process I need to save the execution log somewhere. I am using a bat file:



        
相关标签:
2条回答
  • 2021-01-16 04:24

    This is the one of my way to log everything when I use putty.exe on Windows.

    enter image description here

    0 讨论(0)
  • 2021-01-16 04:33

    The plink is a console application. Actually that's probably it's only purpose. As such, its output can be redirected to a file as with any other command-line command/tool.

    Following example redirects both standard and error output to a file output.log:

    plink.exe -m script.txt username@example.com > output.log 2>&1
    

    See also Redirect Windows cmd stdout and stderr to a single file.

    0 讨论(0)
提交回复
热议问题