LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-27-2009, 04:12 PM   #1
nima0102
Member
 
Registered: Nov 2006
Posts: 209

Rep: Reputation: 30
Download manager with "wget"


Hi
First of all thanks for sharing your experiences on this forum
In my new project I have to program a download server for downloading too files for one company, so I decide to use wget as back-end program and main engine. I need to check status of wget whether or not downloading has been completed and if there is any error, I can check that error so that handle that error.Unfortunately I could not find any information about status of wget yet.

Thanks for any help or guidance
 
Old 12-27-2009, 04:26 PM   #2
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
wget does set the error return code proper, so you can check on success of failure by looking at the error status. In a shell script, for example

Code:
if ! wget <some url...> ; then 
<take action in case of failure>
fi
you can direct the output with the -o switch and examine it later in case of multiple concurrently running wgets.

Hope it helps a bit,
mlp
 
Old 12-29-2009, 12:38 PM   #3
nima0102
Member
 
Registered: Nov 2006
Posts: 209

Original Poster
Rep: Reputation: 30
Thanks
But I need to know completely information about exit status, for example type of error: network failure or server error or etc.
I have found this link about exit status from wget page.
Unfortunately I could not correctly get result from my tests, my results are different those exit status.

Thanks for more information.
 
Old 12-29-2009, 11:13 PM   #4
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
I tried to elicit a few of the error codes different from 1 but couldn't. I think your best bet is to examine the logfile of the transaction in question. For example:

Code:
% wget -o x httx://localhost
% cat x
httx://localhost: Unsupported scheme.

% wget -o x http://localhost:1111
% cat x
--2009-12-30 00:09:50--  http://localhost:1111/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:1111... failed: Connection refused.
Looks easy enough to fish out certain keywords such as the "Unsupported scheme" or "Connection refused" and react properly.

Hope it helps,

mlp
 
Old 12-30-2009, 09:31 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Or just run wget -c a second time, if there's no change in the file and you get a clean exit status, it was successful / completed. Assuming static content. Assuming that the host server supports -c. Assuming assuming assuming....
 
  


Reply



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
How to download VMware server through "wget" paragkalra Linux - Software 3 03-25-2009 04:21 AM
Looking for good or best "multi-thread" or "multiple download" download manger. brjoon1021 Linux - Software 1 09-25-2008 03:26 PM
download manager "Kget" not working after i removed some pkgs b0nd Slackware 9 01-04-2006 06:53 AM
wget fails when i want to download from a URL which contains "=" or "&' noware Linux - General 7 11-13-2005 07:35 AM
Fedora C2 access to "Download Manager" rblampain Fedora 1 03-02-2005 12:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:09 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
Open Source Consulting | Domain Registration