Debian old source synchronization script

Source: Internet
Author: User

The old Debian source synchronization script Debian Lenny source is officially archived, making many servers that cannot update the system unavailable. archive.debian.org is too slow to access and cannot write a script to synchronize lenny source. Due to the structure of the Debian source, it is inconvenient to synchronize the versions separately. The packages are concentrated in the/pool directory, therefore, the script generates the package list of this version based on the index file. ARCH_EXCLUDE is used to filter the packages of different architectures. dists is used to filter the entire lenny source (i386, amd64, source) total 50 Glenny archive source set deb http://mirrors.163.com/debian-archive/ lenny main contrib non-freedeb-src http://mirrors.163.com/debian-archive/ lenny main contrib non-free synchronization script code #! /Bin/sh # author: igi # date: 2012-03-28 TO = "/tmp/debian" FROM = "archive.debian.org: debian-archive/debian" # FROM = "debian. ethz. ch: debian-archive/debian "# FROM =" 2.16.1und1.de: debian-archive/debian "# FROM =" debian. koyanet. lv :: debian-archive/debian "RUNDIR ="/tmp/"ARCH_EXCLUDE =" alpha arm armel armhf hppa hurd-i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x "for ARCH in $ ARCH_EXCLUDE; do EXCLUDE = $ EXCLUDE "\ -- exclude binary-$ ARCH/\ -- exclude * _ $ ARCH. deb \ -- exclude * _ $ ARCH. udeb \ -- exclude installer-$ ARCH/\ -- exclude Contents-$ ARCH * "done # dists = 'lenny etch' dists = 'lenny 'for dist in $ dists; do DIST_INCLUDE =$ {DIST_INCLUDE} "\ -- include/dists/$ dist/contrib/\ -- include/dists/$ dist/main /\ -- include/dists/$ dist/non-free/"DIST_EXCLUDE =" $ {DIST_EXCLUDE} \ -- exclude/dists/$ dist/* "done # sync index filesrsync -- progress-av \ -- include 'Packages.gz '\ -- include 'Sources.gz' \ $ DIST_INCLUDE \ -- include '/dists/' \ -- exclude '/*' \ -- exclude '/dists/*' \ $ DIST_EXCLUDE \ -- exclude 'i18n' \ -- exclude 'installer-amd64' \ -- exclude 'installer-i386' \ -- exclude 'release' \ -- exclude '*. bz2 '\ $ EXCLUDE \ "$ FROM/" "$ TO/" find "$ TO/dists/"-name 'Packages.gz'-exec zgrep 'Filename: '{}+ | awk' {print $2}'> "$ RUNDIR"/filelistfind "$ TO/dists/"-name 'Sources.gz '-exec zcat {}+ | awk' /Directory: /{dir = $2; next};/Files:/{files = 1; next}; files &/^/{print dir "/" $ NF }; /^ [^]/{files = 0; next} '> "$ RUNDIR"/filelist # first stagersync -- progress-v -- recursive -- times -- links -- hard-links \ -- files-from = "$ RUNDIR"/filelist \ "$ FROM/" "$ TO/" # second stagersync -- progress-v -- recursive -- times -- links -- hard-links \ $ DIST_INCLUDE \ -- exclude '/dists /*' \ $ EXCLUDE \ -- exclude '/pool/' \ "$ FROM/" "$ /"

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.