利用wget批量下载http目录下所有rpm文件。制作yum本地源。

# openstack-stein源下载

kdir openstack-stein
cd openstack-stein/
wget -nd -r -l1 -A.rpm --no-parent https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-stein/ -e robots=off

# ceph-luminous

mkdir ceph-luminous
cd ceph-luminous/
wget -nd -r -l1 -A.rpm --no-parent http://mirrors.aliyun.com/ceph/rpm-luminous/el7/x86_64/ -e robots=off

wget -nd -r -l1 -A.rpm --no-parent http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/ -e robots=off

wget -nd -r -l1 -A.rpm --no-parent http://mirrors.163.com/centos/7/os/x86_64/Packages/ -e robots=off

wget -nd -r -nc -p -A.rpm --no-parent http://mirrors.aliyun.com/epel/7/x86_64/Packages/ -e robots=offcd


-nd 不创建目录,wget默认会创建一个目录
-r 递归下载
-l1 (L one) 递归一层,只下载指定文件夹中的内容,不下载下一级目录中的。
–no-parent 不下载父目录中的文件

-p 下载网页所需的所有文件,如图片等

-nc:下载时跳过已经存在的文件

-e robots=off 忽略robots

----------------------------------------------------------------------------------------------------------------------

原文:http://poweroff.cn/linux-system/336.html

原文地址:https://www.cnblogs.com/soymilk2019/p/13533217.html