Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > ssh + curl + disconnects

ssh + curl + disconnects
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 28, 2003, 07:08 AM
 
Hello,
i often ssh into my my os x mac from work and use curl to download files. I have 1 problem and 2 questions. My problem is that if i have curl downloading a large file and i get disconnected from ssh (due to my crappy connection at work) curl stops, and i have to re login and restart the download (i use resume). How do i give a command via ssh to "do this in the background" like it will start curl with my specifications but keep it running reguardless of whether or not i keep the ssh session open.

thanks all
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 28, 2003, 07:25 AM
 
Use nohup:

Code:
nohup curl -O "someurl" > curllog.txt &
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Fresh-Faced Recruit
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 28, 2003, 07:34 AM
 
So with this command even if im completely disconnected from the server (via ssh), curl will continue to run?

thanks
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Aug 28, 2003, 09:34 AM
 
A better way than nohup may be to use the screen command. This creates a virtual screen that when you disconnect simply "detaches". You can login again and "reattach" to the screen.

To start a new screen just run:
screen

To detach a currently running screen:
Press Control-A Control-D

To list currently running screens:
screen -ls

To re-attach to a screen:
If only one screen is running screen -r or if multiple screens are running screen -r pid.tty.host. The pid.tty.host is available in the screen list.

To attach to a screen that hasn't been detached:
Replace screen -r with screen -x

There's a bunch more options, read about them in the manual:
man screen

- proton
     
Fresh-Faced Recruit
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 28, 2003, 09:47 AM
 
awesome! the screen command is great! thanks to both for all your help.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:14 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2