LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   end ssh session without stopping programs (http://www.linuxquestions.org/questions/linux-newbie-8/end-ssh-session-without-stopping-programs-72164/)

joshf 07-12-2003 03:12 PM

end ssh session without stopping programs
 
I log into my redhat server with ssh. I start an ftp session between the server a public ftp server. I start a file downloading from the public ftp server to my server. If I end the ssh session between my local computer and my server, the download from the public ftp to my server stops as well.

I would like to be able to ssh to my server, start a download, and end the ssh session without stopping the download.

How can I do this?

david_ross 07-12-2003 03:34 PM

If you run the transfer as a single command and put and ampersand "&" at the end it should stay running.

vijlovely 07-12-2003 03:43 PM

You can also use nohup for such things.
I think it is much more reliable...
thats what I think..a :newbie:
Vijayant

joshf 07-12-2003 03:54 PM

Thanks!!! That is what I was looking for!

vijlovely 07-12-2003 04:12 PM

No problems josh..
Good to know that a newbie can also help another newbie.
Take care
Vijayant:)

joshf 07-12-2003 06:38 PM

Another question about nohup:

I gave the command:
nohup ftp

Then, I opened another ssh session to view nohup.out as I connected and choose files to download.

That did work, but is there a way to have the output displayed to the screen instead of the file? That would be easier than opening nohup.out after each command I type.

vijlovely 07-12-2003 07:28 PM

Quote:

Originally posted by joshf
Another question about nohup:

I gave the command:
nohup ftp

Then, I opened another ssh session to view nohup.out as I connected and choose files to download.

That did work, but is there a way to have the output displayed to the screen instead of the file? That would be easier than opening nohup.out after each command I type.

I can tell you an easier way to get all this done provided u know what you have to do after doing an ftp
Step 1
create a .netrc file with the following text (all in one line)

machine <name of the ftp server/machine> login <login> password <password>

save this file.. make sure u have the file named .netrc

now write the command :
chmod 700 .netrc

ok..
now open a new text file (lets call it input.txt) and write all the ftp commands in this file ... e.g.

bin
cd test1
mget dummy.zip
bye

and now u can straightaway write the command
nohup ftp <name of the ftp server> < input.txt


Check this out and do let me know if it solves ur problem..
Cheers
Vijayant:newbie:

david_ross 07-13-2003 09:39 AM

Why not just do it all on the cli with wget?

Using an "&" will put it on the screen.


All times are GMT -5. The time now is 01:43 PM.