On 11/14/2016 02:17 AM, bruce wrote:
I think I'm getting closer to an actual soln...
** Notice the backticks around the remote cmd to be run
-without the ticks, the cmd doesn't appear to work
ssh crawl_user@192.81.214.49 'screen -r "testname" -X "`nohup ls -al
/crawl_tmp/* > aa.tmp`" '
ssh crawl_user@192.81.214.49 'screen -r "testname" -X "`nohup sleep 10`" '
ssh crawl_user@192.81.214.49 'screen -r "testname" -X "`nohup sleep 10`" & '
If the backticks are required, ok the final part of the solution is to
make the whole thing run the cmd in the screen session, but return
back to the calling term, once the screen session/cmd starts.
The backticks makes your command run in your local sub-shell, not the
remote one.
Also if you want interactive session, you need to use -t switch to the
ssh command.
In other words I want the long running/remote process to start running
in the screen session and return the control to the calling term
without waiting for the completion of the process.
With the basic tests using the sleep func.. it appears that my current
attempts aren't quite there yet.
I don't want to put the remote/running cmd in the background, as that
would disable the ability to see/view the display output of the
process.
Tried to put the screen process in the background.. no luck..
Thoughts/comments???
THanks
On Sun, Nov 13, 2016 at 1:00 PM, Patrick O'Callaghan
<pocallaghan@xxxxxxxxx> wrote:
On Sun, 2016-11-13 at 10:09 -0500, bruce wrote:
The goal, to be able to reattach to a remote screen session, and to
run a cmd in the remote screen session, and have the cmd return to the
calling term
Maybe take a look at expect (dnf info expect).
poc
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
--
Jakub Jelen
Software Engineer
Security Technologies
Red Hat
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx