I am trying to figure out a way to make wget only create a file if the valid response to the download is valid, i.e. a status code of 404 or 500, total 200.
However, when using the -O option (to specify the file name), it will always create a file with the contents of the error page, and I have not found a way to indicate that it should ignore it if it receives 404.
Do I need to check the exit code and output the result, or is there a better alternative?
wget
jishi Mar 16 '09 at 8:41 2009-03-16 08:41
source share