Hi Jakub
So you're saying
ssh crawl_user@192.81.214.49 'screen -r "testname" -X "`ls -al /crawl_tmp/* > aa.tmp`" '
is not the correct approach to running a remote cmd in a screen session, and that the cmd wrapped in the backticks is run on the local machine, not the remote machine???
changing the cmd, using the "-t" or the "-f" doesn't work either. - also tried changing the quotes wrapping the remote cmd from double to single quotes. as I understand it, the expansion of the cmd within the quotes, changes depending on the single or double quote used.
ssh -t crawl_user@192.81.214.49 'screen -r "testname" -X "ls -al /crawl_tmp/* > aa.tmp" ' ssh -t crawl_user@192.81.214.49 "screen -r "testname" -X 'ls -al /crawl_tmp/* > aa.tmp' "
So if you (or anyone else) has actual test cmds/funcs that I can implement post, and I'll gladly test.
But for now, can't seem to find the subtle error..
Thanks
On Mon, Nov 14, 2016 at 3:05 AM, Jakub Jelen jjelen@redhat.com wrote:
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@gmail.com 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@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
-- Jakub Jelen Software Engineer Security Technologies Red Hat
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org