yum install yum-utils createrepo -y
CentOS mirror
cd /var/www/html
cat << EOF > sync-centos.sh
#!/bin/sh
#
# reposync
#
BASEDIR=/var/www/html/centos/6
mkdir -p \$BASEDIR
cd \$BASEDIR
reposync -n -r updates
repomanage -o -c updates | xargs rm -fv
createrepo updates
reposync -n -r base --downloadcomps
repomanage -o -c base | xargs rm -fv
createrepo base -g comps.xml
EOF
chmod 755 sync-centos.sh
sh sync-centos.sh
OpenNode mirror
rpm -ivh http://opennodecloud.com/CentOS/6/opennode/x86_64/RPMS/opennode-release-6.0-4.x86_64.rpm
cd /var/www/html
cat << EOF > sync-opennode.sh
#!/bin/sh
#
# reposync
#
BASEDIR=/var/www/html/centos/6
mkdir -p \$BASEDIR
cd \$BASEDIR
reposync -n -r opennode --downloadcomps
repomanage -o -c opennode | xargs rm -fv
createrepo opennode -g comps.xml
reposync -n -r opennode-test --downloadcomps
repomanage -o -c opennode-test | xargs rm -fv
createrepo opennode-test -g comps.xml
reposync -n -r opennode-dev --downloadcomps
repomanage -o -c opennode-dev | xargs rm -fv
createrepo opennode-dev -g comps.xml
EOF
chmod 755 sync-opennode.sh
sh sync-opennode.sh
Zabbix mirror
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
cd /var/www/html
cat << EOF > sync-zabbix.sh
#!/bin/sh
#
# reposync
#
BASEDIR=/var/www/html/centos/6
mkdir -p \$BASEDIR
cd \$BASEDIR
reposync -n -r zabbix
repomanage -o -c zabbix | xargs rm -fv
createrepo zabbix
EOF
chmod 755 sync-zabbix.sh
sh sync-zabbix.sh
EPEL mirror
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
cd /var/www/html
cat << EOF > sync-epel.sh
#!/bin/sh
#
# reposync
#
BASEDIR=/var/www/html/centos/6
mkdir -p \$BASEDIR
cd \$BASEDIR
reposync -n -r epel
repomanage -o -c epel | xargs rm -fv
createrepo epel
EOF
chmod 755 sync-epel.sh
sh sync-epel.sh
Update all
cd /var/www/html
for i in ls | grep sync; do sh $i; done