wgetのオプション
公式のマニュアルはこれ。
—recursive, —level=
Section titled “—recursive, —level=”再帰的にダウンロードするかどうかのフラグ。再起する場合、—level= オプションでサブディレクトリの深さを指定できる。—level=0 または —level=inf で無制限。デフォルトは —level=5 らしい。
—content-on-error
Section titled “—content-on-error”4xx や 5xx エラーが発生してもエラーのページを保存する。
これはエラーを無視するオプションではないので、なんらかのエラーが発生している場合は —content-on-error の有無に関わらず wget がゼロ以外の値で終了する。
—include=, —include-directories=
Section titled “—include=, —include-directories=”条件にマッチしたディレクトリをダウンロード対象とする。カンマで区切って記述するが、直下までしか対象としない。例えば -I /files/repo@* とした場合、/files/repo@a や /files/repo@b にはマッチするが、/files/repo@a/x にはマッチしない。
ワイルドカードは *, ?, [] が使える。
—exclude=, —exclude-directories=
Section titled “—exclude=, —exclude-directories=”—include= の逆でマッチしたディレクトリを対象としない。同時に指定すると、おそらく —exclude= の方が強い。
—accept, —reject=
Section titled “—accept, —reject=”ファイル名と拡張子を対象とするフィルタ。対象が異なるだけで動作は —include= 等と同じ。
—accept-regex=, —reject-regex=
Section titled “—accept-regex=, —reject-regex=”URL全体を正規表現でマッチする。だいたい —include= や —accept= 等と同じ。
—domains=, —exclude-domains=
Section titled “—domains=, —exclude-domains=”対象がドメインになるだけ。
—convert-links, —adjust-extension
Section titled “—convert-links, —adjust-extension”リンク先のURLをダウンロードしたファイルに書き換える。ただしこのとき、リンク先が —exclude= 等でダウンロード対象外となったファイルへのリンクは変換しない。
例えば a.html は対象のファイルで、ファイル中に x/file.html へのリンクが存在している場合、a.html 自体はダウンロードするが x/file.html へのリンクはそのままの状態で残る。
—no-host-directories
Section titled “—no-host-directories”ホスト名を付けない。
—no-parent
Section titled “—no-parent”調査しているファイルより上の階層にあるファイルはダウンロードしない。—include= よりも強力なので、/files/a.html を処理している際に /static/a.png への参照があっても(上の階層にあるので)無視する。
—page-requisites
Section titled “—page-requisites”これは —no-parent よりも優先されている気がする。調べてない。