리눅스

nexus 3 기준 일괄 업로드 sh 스크립트

초이짬 2021. 5. 4. 11:07
728x90

일이 바빠서 스크립트만 덜렁 써놓고...

아래 스크립트는 기본적으로 nexus에 yum 관련 rpm 파일을 일괄 업로드 하는 거임 외부망에 yum repo를 옮기는게 목적

#!/bin/bash
files="./files.out"
username="계정"
password="비번"
nexusurl="http://접속주소/repository/yum-hosted/"
find . -name '*.rpm' -type f | cut -c 3- | grep "." > $files
while read i; do
echo "upload $i to $nexusurl"
curl -v -u $username:$password --upload-file $i "$nexusurl$i"
done <$files
728x90