LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-02-2007, 10:56 AM   #1
guthrie
Member
 
Registered: Jul 2003
Location: Iowa
Distribution: Debian
Posts: 32

Rep: Reputation: 15
wget -ignore failures?


I want to use wget to download all .gif's in a directory, but don't know exactly what's there. So I just did a series of:
wget http://www.place.org/name001.gif

then 002.gif, etc.

But if the file is missing, I download an HTML page saying "not found".

How can I tell wget to fail silently if a file is not there? OR perhaps, since the server is detecting this and giving the error message, it is hopeless?

I'd think I should also be getting back an HTML 404 error code for file missing, but perhaps the server is masking that in the more polite web page error response.

Thanks,
Greg

Last edited by guthrie; 03-02-2007 at 11:01 AM.
 
Old 03-05-2007, 08:39 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by guthrie
How can I tell wget to fail silently if a file is not there? OR perhaps, since the server is detecting this and giving the error message, it is hopeless?
Since this seems to be the server's doing, I would think what you have requested is hopeless. But I would think you could write a trivial script that downloads the file and uses the file command to determine if it is a gif and deletes it if it isn't. You could even automate the files you attempt to download to save yourself some tedium.

EDIT: On additional reflection, you might be able to use wget's --header option so your request looks like it's the result of the image being part of a web page. But unless you are fairly familiar with these internal workings (I am not), it is probably easier to impliment my previous suggestion.

Last edited by blackhole54; 03-05-2007 at 08:46 AM.
 
  


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
wget - problems making it ignore a link jlpktnst Linux - Software 2 06-09-2006 06:31 AM
[logcheck] ignore.d and logcheck.ignore cyberpunx Linux - Software 0 09-18-2005 05:07 PM
Just ignore this menvem General 6 09-20-2004 07:26 PM
acpi(please don't ignore) meccax5 Mandriva 10 06-17-2004 09:06 PM
test ignore!!! NetAX General 1 06-07-2004 10:57 AM

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

All times are GMT -5. The time now is 08:58 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