wget options

Normally the defaults used by wget are good enough for most users, however, you may need to tweak things from time to time to get it to work the way you want it to.

Here is a partial list of some of the wget options:

wget option

Explanation

-o filename

Output messages to a log file. This was covered earlier in the chapter.

-t number

Try number times before giving up on the connection.

-c

Continue to download a partially downloaded file from a previous wget.

-S

Display the headers sent by the server.

-Q number

The quota, or total amount of bytes that will be downloaded. Number can be in bytes, kilobytes (k), or megabytes (m). Set to 0 or inf for no quota.

-l number

This specifies the maximum recursion level. The default is 5.

-m

This is good for when trying to create a mirror of a site. It is equivalent to using the -r -N -l inf --no-remove-listing options.

Another thing you may try is to turn on debugging with the -d option. Note that this will only work if your version of wget was compiled with debug support. Let's see what happens when I try it on my system:

wget options

I wasn't sure if debugging was turned on or not, now I know. This output might not be very useful unless you are a developer, however, if you ever need to send in a bug report on wget they are going to ask for the debug output.

As you can see, wget is a very powerful program with several options.

Note

Remember to use wget with care and do not forget to put a sleep of at least a minute in your loop. An hour would be even better.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset