Projekt

Allgemein

Profil

Howto wget » Historie » Version 2

Jeremias Keihsler, 13.01.2017 10:49

1 1 Jeremias Keihsler
h1. Howto wget
2
3
@wget@ is used to retrieve files via @http@ or @ftp@ protocol.
4
5
h2. preliminary note
6
7
this is an excerpt from http://www.gnu.org/software/wget/manual/wget.html
8
9
h2. FTP usage
10
11
get all files from ftp-server recursive:
12
<pre><code class="bash">
13
wget -r --ftp-user=FTPUSERNAME --ftp-password='secret-code' ftp://ftp.example.com
14
</code></pre>
15 2 Jeremias Keihsler
by default the max. recursive level is 5
16 1 Jeremias Keihsler
17
if you need to transfer deeper directory structures (e.g. 20 levels) use:
18
<pre><code class="bash">
19
wget -r -l 20 --ftp-user=FTPUSERNAME --ftp-password='secret-code' ftp://ftp.example.com
20
</code></pre>
21
22
if you want to transfer the files to a specific directory use:
23
<pre><code class="bash">
24
wget -P /tmp -l 2 --ftp-user=FTPUSERNAME --ftp-password='secret-code' ftp://ftp.example.com
25
</code></pre>
26
27
if you want to transfer the files without the generation of 'server_name/...' directory-structure consider using the @cut@ and @nH@-options
28
29
double check with http://www.gnu.org/software/wget/manual/wget.html#Directory-Options
30
<pre><code class="bash">
31
wget -nH --cut-dirs 2 -P /tmp -l 2 --ftp-user=FTPUSERNAME --ftp-password='secret-code' ftp://ftp.example.com
32
</code></pre>