Centos Local Yum Source build-up

Source: Internet
Author: User
Tags rsync

The first step:

From the Yum source of the Rsync protocol, the synchronization script is as follows:

[email protected] crontab]# cat yum_update.sh
#!/bin/bash
Date= ' Date +%f '
echo $date >/var/log/yum_update.log
######### #Centos
Sour_url= "Rsync://centos.ustc.edu.cn/centos"
oslist= "6.6"
Os_plant= "x86_64"
Cmd= "RSYNC-AVRT"
Cmd=${cmd}${sour_url} "/" ${sour_dir} "/"
Outdir= "/home/himalayas/yum/centos/6/" # # if change, please notice the line of Epel, Rpmforge, rpmfusion
For yumdir in OS updates Extras centosplus contrib;
Do
test-d $outDir/$yumdir | | Mkdir-p $outDir/$yumdir
RSYNC-AVRT $sour _url/$osList/$yumdir/$os _plant $outDir/$yumdir >>/var/log/yum_update.log &
Done

######### #epel
test-d/home/himalayas/yum/epel/6/x86_64 | | Mkdir-p/home/himalayas/yum/epel/6/x86_64
RSYNC-AVRT--exclude=debug/--exclude=repoview/rsync://centos.ustc.edu.cn/fedora/epel/6/x86_64//home/himalayas/ yum/epel/6/x86_64 >>/var/log/yum_update.log &

######### #rpmforge
test-d/home/himalayas/yum/rpmforge/6/rpmforge/x86_64 | | Mkdir-p/home/himalayas/yum/rpmforge/6/rpmforge/x86_64
test-d/home/himalayas/yum/rpmforge/6/extras/x86_64 | | Mkdir-p/home/himalayas/yum/rpmforge/6/extras/x86_64
RSYNC-AVRT rsync://mirror.cpsc.ucalgary.ca/dag/redhat/el6/en/x86_64/rpmforge//home/himalayas/yum/rpmforge/6/ rpmforge/x86_64 >>/var/log/yum_update.log & # # #4678
RSYNC-AVRT rsync://mirror.cpsc.ucalgary.ca/dag/redhat/el6/en/x86_64/extras//home/himalayas/yum/rpmforge/6/ extras/x86_64 >>/var/log/yum_update.log &

######### #rpmfusion
test-d/home/himalayas/yum/rpmfusion/free/x86_64 | | Mkdir-p/home/himalayas/yum/rpmfusion/free/x86_64
test-d/home/himalayas/yum/rpmfusion/nofree/x86_64 | | Mkdir-p/home/himalayas/yum/rpmfusion/nofree/x86_64
RSYNC-AVRT rsync://centos.ustc.edu.cn/fedora/rpmfusion/free/el/updates/6/x86_64//home/himalayas/yum/rpmfusion/ free/x86_64 >>/var/log/yum_update.log &

RSYNC-AVRT rsync://centos.ustc.edu.cn/fedora/rpmfusion/nonfree/el/updates/6/x86_64//home/himalayas/yum/ rpmfusion/nofree/x86_64 >>/var/log/yum_update.log &


Note:

1, visit this URL: centos.ustc.edu.cn/centos/, when the version update all RPM package may have 6.5 go to 6.6 of the directory, this time to manually change the variable: oslist= "6.6", and then preferably manually executed once, See if updates can be synchronized.

2, you can use the following command to view the other Rsync source directory structure and all RPM packages

RSYNC-AVRT rsync://centos.ustc.edu.cn/centos/6.6/os/x86_64


Step two: Add to crontab synchronize once a day

XX * * * */bin/bash/kuxun/crontab/yum_update.sh

Centos Local Yum Source build-up

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.