I have a command that will SSH and run a script after SSH'ing. The script runs a binary file.
Once the script is done, I can type any key and my local terminal goes back to its normal state. However, since the process is still running in the machine I SSH'ed into, any time it logs to stdout
I see it in my local terminal.
How can I ignore this output without monkey patching it on my local machine by passing it to /dev/null
? I want to keep the output inside the machine I am SSH'ing to and I want to just leave the SSH altogether after the process starts. I can pass it to /dev/null
in the machine, however.
This is an example of what I'm running:
cat ./sh/script.sh | ssh -i ~/.aws/example.pem ec2-user@11.111.11.111
The contents of script.sh
looks something like this:
# Some stuff...
# Run binary file
./bin/binary &
Solved it with
./bin/binary &>/dev/null &
Copy the script to the remote machine and then run it remotely. Following commands are executed on your local machine.
Note,
logfile
will be created on the remote machine.