Johannes Franken
<jfranken@jfranken.de>
Program | Transport | Scope | Performance | |||||||
---|---|---|---|---|---|---|---|---|---|---|
local | http(s) | ftp | pipe | delete | filedate | permissions | differential | partial | compression | |
wget | - | X | X | - | - | X | - | X | X | - |
cp -duRp | X | - | - | - | - | X | X | X | - | - |
tar | X | - | - | X | - | X | X | - | - | X |
rsync | X | - | - | X | X | X | X | X | X | X |
wget options URL |
wget wil direct its ftp- or http-requests automatically to your proxyserver, if the environment varibale http_proxy oder ftp_proxy are set, e.g. by
Option implication -N Do not download files that are already available locally and match the server's filedate. -nH --cut-dirs=2 In recursive mode, wget normally creates a subdirectory for the hostname and any directories mentioned in the URL. The option -nH suppresses the creation of hostdirs, and --cut-dirs=2 the creation of the first two directories. For example: wget -r -nH --cut-dirs=2 http://www.jfranken.de/homepages/johannes/vortraege will create the directory vortraege. -k turns absolute URLs to relative ones in HTML-files. Caution, this does not work in any situations. -r -np (recursive, no-parent): If the given URL provides a html-file, wget will also fetch any elements referenced (in particular links and graphics) and repeat this procedure for them. The option -np avoids ascending to the parent directory. wget ignores references to other hosts, except if you set the parameter -H. -p -l 10 The parameter -l 10 limits the recursion depth for -r to 10 levels. The default depth is 5. If you set -l 0, it downloads at infinitive depth, which can cause filesystem problems on cyclic links. -H -Djfranken.de,our-isp.org Also follow links to different servers, if they belong to the domain jfranken.de or our-isp.org. -nv Avoids output of debugging messages.
$ export http_proxy=http://jfranken:secret@proxy.jfranken.de:3128/ $ export ftp_proxy=$http_proxy |
rsync options source(s) target |
Explanation for the notation of source and target:
Option implication -a (archive mode): copies any subdirectories, most attributes (symlinks, permissions, filedate, group, devices) and (if you're root) the owner of the files. -v --progress (verbose): -v prints a list of files during transfer. If you additionally set --progress, it will continuously show you the number of bytes transferred and the progress in percent. -n (dry-run): Don't write, just simulate the procedure. -z -e program If there is a colon in the source or target, rsync interprets the part before it as hostname and communicates over the program specified by -e, to which it passes the following parameters: ssh works great as a program for -e. If you want to insert your own parameters at the beginning of the parameter list, you need to put them in double quotes with the program.
- as source: hostname rsync --server --sender . Sourcedir
- as target: hostname rsync --server . Targetdir
The parameter -z makes rsync compress any data it transfers.--delete --force --delete-excluded deletes any entries from the target directory, which have been deleted from the source meanwhile. --partial Don't delete the partial files if the connection is lost. This way rsync can resume the transfer next time. --exclude=pattern Ignore any files which match the given pattern, e.g. --exclude *~ . Read more on rsync's extensive exluding capabilities in the rsync(1) manpage. -x excludes any files on filesystems, that are mounted into the source directory.
$ tar cf - mydir/ | ssh gate 'cd /tmp && tar xpvf -' |