LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-08-2004, 01:33 PM   #16
dwater
Member
 
Registered: Mar 2004
Distribution: redhat 9
Posts: 34

Original Poster
Rep: Reputation: 15

Quote:
Originally posted by ilikejam
If you want to put a command into the background (demonise):

{ [command] > /dev/null 2>&1 < /dev/null & } &

So I would write a script with all the ftp commands in it and run it with, say;

{ uploadsite > /dev/null 2>&1 < /dev/null & } &

That disconnects lftp (or any other program) from the console (the /dev/null redirects), and makes it a grandchild process (the two &'s), so the shell it was launched from can't kill it.

Dave
This assumes a sh compatible shell, right.

I wasn't really asking this. I was asking for how to put a command run within lftp into the background. Something like this :

lftp
lftp :~> open bla bla
lftp :~> mirror -R from_dir to_dir &
lftp :~> quit

Note the '&' which makes it go into the background, except I couldn't get it to work, so I assumed I was doing something wrong.

I guess I could put the whole thing into the background, but it would make sense to make lftp go qiuet in that instance. ?

Max.
 
Old 04-08-2004, 01:46 PM   #17
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
lftp can indeed do several parallel processes, and what you have above should work. It works for me - the file I have which contains the commands to mirror my website looks like:

open -u <user>,<pass> dslftp.dsl.pipex.com
lcd /home/dave/webStuff/ILikeJam/
mirror -R -e &
quit

And that returns straight to the shell and continues uploading in the background.

If you do use the shell method in post #15 then you won't get any output to the shell, and you won't be able to get any input to lftp either, so it won't matter how quiet lftp is.

Dave
 
Old 04-08-2004, 08:09 PM   #18
dwater
Member
 
Registered: Mar 2004
Distribution: redhat 9
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by ilikejam
lftp can indeed do several parallel processes, and what you have above should work. It works for me - the file I have which contains the commands to mirror my website looks like:

open -u <user>,<pass> dslftp.dsl.pipex.com
lcd /home/dave/webStuff/ILikeJam/
mirror -R -e &
quit

And that returns straight to the shell and continues uploading in the background.
Hmm. OK, that's good. I was just not sure how you know it is working. How can you tell it is still working?

I have been used to using wget (in the other direction, obviously), and then using 'tail -f wget.log...' to look at the progress when I want to see. Is there anything like that for lftp?

Max.
 
Old 04-08-2004, 09:07 PM   #19
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
I know it's working, because lftp is still in the process listing ($ ps -A), so I know it's still running.

Unfortunately, there's no indication as to how far along lftp has got, though.

Dave
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp mirroring gonzo22 Linux - Software 2 04-11-2005 02:29 PM
SGI IRIX su problem - "Running with insufficient privileges" neilman Other *NIX 5 12-19-2004 06:42 PM
A question about Irix and SGI Servers veritas General 1 05-08-2004 08:58 PM
FTP mirroring RajaRC Linux - General 1 03-10-2004 11:41 AM
SGI workstation running Irix 6.5 njacobsen Linux - General 1 11-30-2001 12:04 PM


All times are GMT -5. The time now is 10:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration