30 Mart 2018 Cuma

RedHat reposunu yedeklemek

Bu gün boş boş otururken, redhat reposunu yedekleyen bir script hazırlayayım dedim.  rhel reposunu yansilamak isteyenler, kendilerine uygun değişikliği yaparak kullanabilirler.

Tüm repoları indirebilmek için, rhn den repoları aktifleştirmek gerektiğinide unutmamak lazım. :)

Eyu eğlenceler.




################################################
#!/bin/bash
# Bu script Remzi AKYUZ tarafindan, redhat paketlerini yerelden kullanmak icin hazirlanmistir.
# Her hangi bir sorunuz olursa, lutfen sorunuz.
# eposta: remziakyuz@gmail.com
#set -x
# time reposync --gpgcheck -l --repoid=

repolar=( 'jbappplatform-4.3.0-fp-x86_64-server-5-rpm' 'jbappplatform-4.3.0-x86_64-server-5-rpm' 'jbappplatform-6.4-x86_64-server-5-rpm' \
          'jb-ewp-5-x86_64-server-5-rpm' 'jb-ews-2-x86_64-server-5-rpm' 'jb-wfk-1-x86_64-server-5-rpm' \
          'rhel-x86_64-rhev-agent-5-server' 'rhel-x86_64-server-5' \
          'rhel-x86_64-server-5-mrg-management-2' 'rhel-x86_64-server-5-mrg-messaging-2' 'rhel-x86_64-server-5-thirdparty-oracle-java' \
          'rhel-x86_64-server-cluster-5' 'rhel-x86_64-server-cluster-storage-5' 'rhel-x86_64-server-dts2-5-beta' 'rhel-x86_64-server-fastrack-5' \
          'rhel-x86_64-server-productivity-5' 'rhel-x86_64-server-rhsclient-5' 'rhel-x86_64-server-scalefs-5' 'rhel-x86_64-server-supplementary-5' \
          'rhel-x86_64-server-vt-5' 'rhn-tools-rhel-x86_64-server-5' )

count=0

cd /arsiv/redhat-repo/rhel-5
while [ "${repolar[$count]}" != "" ]
do

reponame="${repolar[$count]}"



if [ -x $reponame ]; then
                          echo repo olusturulmus
                          echo repolar guncellestirilecek
                          sleep 3
                          time reposync --gpgcheck -l --repoid=$reponame --download_path=$reponame
                     else
                          echo repo olusturuluyor $reponame
                          mkdir $reponame
                          createrepo $reponame
fi                       
                 
let "count = $count + 1"

done


exit 0
################################################



Hiç yorum yok:

Yorum Gönder