1

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:

C:\Ptty\plink.exe root@<IP> -pw <password> -m C:\Ptty\LaunchFile.txt

The C:\Ptty\LaunchFile.txt contains my command that i want to run.

./Launch.sh jobName=<job name> restart.mode=false

Is there a way to save the execution log so that I can monitor it later... ?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Ravinder
  • 19
  • 1
  • 2

2 Answers2

1

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.

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
0

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

enter image description here

pmverma
  • 1,653
  • 13
  • 27