Input/output redirection is the basic of shell scripting. Just do
Code:
ssh user@host "command > logfile"
this redirects the standard output of the command (script) to logfile on the
remote machine. The following will redirect the output to a file on the
local machine: note the different position of the redirection: inside the double quotes in the command above, outside in the command below.
Code:
ssh user@host "command" > logfile