yum安装包下载

#!/usr/bin/env sh

FILENAME="


"

for NAME in $FILENAME
do
    wget http://mirrors.aliyun.com/ceph/rpm-jewel/el7/x86_64/$NAME
done




[root@kolla pachong]# cat pachong.py 

#!/usr/bin/env python
#encoding: utf8
#
import urllib2
import urllib
import re
import os
downPath = '/home/hadoop/pachong//'
urlPath = 'http://mirrors.aliyun.com/ceph/rpm-jewel/el7/x86_64/'
res = r'href="(.*[^src]\.rpm)"'
Cres = re.compile(res)
content = urllib2.urlopen(urlPath).read()
softList = Cres.findall(content)
for i in softList:
    urlSoftware = os.path.join(urlPath,i)
    urllib.urlretrieve(urlSoftware,downPath + '/' + "%s" % i)

猜你喜欢

转载自blog.csdn.net/xsjzdrxsjzdr/article/details/80531382