#!/bin/bash . urldat domain="http://www.baidu.com" for i in $filename { if [[ -e $i ]];then echo "$i file is exist">>log.log else { name=${i##*/} path=${i%%/$name} if [[ -d $path ]];then echo "wget $domain/$i to $path/$name" >>wget.log wget -c $domain/$i -o $path/$name -nv if (( $? != 0 ));then echo "down $i is fail" >>log.log fi else echo "mkdir -p $path" echo "wget $i to $path/$name" wget -c $domain/$i -o $path/$name -nv if (( $? != 0 ));then echo "down $i is fail" >>log.log fi fi } fi }
转载请注明:LINUX服务器运维架构技术分享 » 批量下载 抓取内容