Tuesday, May 21, 2013

Download a script and run it and log output



Run on box a
ssh root@carebears-hv-01.pony.com "wget http://unicorn.com/test " -O - | sh - 2>&1 | tee log_file.txt"


File on box b "unicorn"

##cat test
#!/bin/sh

echo "this is a test"





output on box c "carebears"
# cat log_file.txt
this is a test

Look its magic

No comments: