ssh - how to close connection from bash script
i'm connecting to a remote box with this line in a bash script:
Code:
ssh user_acct@ip_address command_to_run (mandriva 2007.1) thanks, BabaG |
well just quit the script, and the shell will collapse back until ssh itself is terminated. if you just run an "ls" you'll see ssh quits after the ls. same goes for any other script you wish to execute.
|
thanks acid_kewpie.
what i want to do, though, is to start a script on the remote and close the ssh connection, leaving the remote script running. is this not possible? the remote script will take a long time to run and i want to move on to other parts of the local script which initiated the remote one. if i leave the ssh connection up and try to move on in the local script, the console screen keeps getting interrupted with output from the remote. that's one reason i just want to start the remote and leave. any thoughts on how to do this? is it even possible? might i have to open new consoles for each new connection? thanks, BabaG |
run your script nohup
Quote:
|
thanks grizly. now, how do i close the connection?
BabaG |
Quote:
Quote:
|
i think i might be starting to get it. would adding an '&'
Code:
ssh user_acct@ip_address /home/me/bin/commands.sh & 1. ssh into the remote 2. start the 'commands.sh' script as a background script 3. return to the local script or shell (because of the '&') leaving the 'commands.sh' script running remotely? do i have that right? thanks so much. nohup sounds very useful. (assuming i'm getting it) BabaG |
Oh yeah, thats even better! ;)
|
All times are GMT -5. The time now is 09:50 PM. |