I have a script which does ssh to all the servers and shows the output for each execution; can I redirect those outputs to /var/tmp/filename_output.txt on server1?The script runs from server1 to all the server. These are the commands I'd like to execute to run the script and save the output:ssh server1./script.sh > /var/tmp/filename_output.txtssh server2./script.sh >> server1:/var/tmp/filename_output.txtssh server3./script.sh >> server1:/var/tmp/filename_output.txt
Redirecting the output of a script to the remote server via scp or ssh
shell script;ssh;remote
EDIT:I have been doing some test if you run the command like this you will get local outputssh yourserver < ./your_script.sh > your_script.stdoutEND EDITFrom my point of view you have two options. Option 1After running script.sh on each server and been written the command output to /var/tmp/filename_output.txt on remote serverscp /var/tmp/filename_output.txt myserver:/prefered_location/server_name.logrm /var/tmp/filename_output.txtOption 2Export a NFS from your server and importing on every server on your network, that way you can have a local FS on each of the other server pointing to the main one and your problems are solved by putting the command output on a file inside the FS pointing to the NFS. If you need instruction on how to export a NFS and import it on client machines let me know