[Hudlug] potentially stupid question!

Tim hudlug at mailman.lug.org.uk
Tue May 6 02:31:00 2003


davepattern@ntlworld.com wrote:
> Is it possible to connect, do some work and maybe leave a program 
> running, then disconnect and then reconnect to the same shell later 
> on?  (i.e. when I reconnect I get the same shell I was looking at 
> before).  For example, can I connect, start an FTP download, 
> disconnect and then reconnect later on to see how the download is 
> going?


You need to install a program called screen.

Logon, run screen, do whatever you want to do.

When you have done, do <ctrl-a> and d  (I think).  The processes will 
still run

When you want to reconnect, logon, and then do screen -r and you will 
reconnect exactly as you were.


If you just want to do a download, then just use wget with the -b 
(background) option.  An & on the end of the command line has very 
similar results.

Also, in theory you should be able to <ctrl-z> and bg and then logoff a 
wget session without killing it.


You should also be able to do things like

wget -nv http://some.url.com/hsjh/ | mail <my mail address> &

Which should run in the background and email you the results.  I'm not 
quite sure if you need the -nv (not verbose).  I have a feeling that 
just piping will turn off the fancy status indicators.



Another way to do it would be to use the batch program.  This is way to 
run programs when the machine is lightly loaded (from the old days, when 
if your loadavg wasn't > 6 then you weren't using the machine to its 
limits.)   But it is also a useful way to run longrunning commands and 
have the results emailed back to you.

Tim