#!/bin/bash # $ GPL2 by yjmenezes at gmail.com versao 1.0 2012-02-17 $ # baixa arquivos, diretorios e subdiretorios filtrando if [ $# -lt 1 ] then echo `basename $0` "url_fonte [dir_destino_cp]" 1>&2 exit 1 fi cd /tmp/ if [ $# -ge 2 ] then mkdir -p $2 cd $2 fi # -nH Disable generation of host-prefixed directories. # --no-parent Do not ever ascend to the parent directory # --cut-dirs=2 wget -r -nH --cut-dirs=2 --no-parent --reject="index.html*" $1 exit 0