#!/bin/bash
# 20080611 locking; bash
# 20080612 function
# 20090318 --filter
# 20090320 better filtering patterns; --delete-excluded to actually delete
# 20090415 skip if mirrored < N h ago - N == 2; empty line after each single mirroring
# 20090417 settable time gap
# 20090427 mirror() from mirror-functions
# 20090925 "- /9/**"
# 20091016 "- /test/12-A**"
# 20091116 "- /test/12-**"
# 20091207 updates "- /9/**"
# 20091221 releases: "- 10/Fedora/*/iso/*"
# 2010-01-11 releases: "- 10/Fedora/*/iso/*" -> "- /10/**"
# 2010-01-26 updates: "- /10/**" "- testing/(9|10)/**"
# 2010-02-01 updates: "- testing/(9|10)/**" -> "- testing/9/**"
# 2010-03-04 releases: "- 11/*/ppc**"
# 2010-04-11 releases: "- test/13-A**"
# 2010-04-14 releases: "- 11/*/ppc**" -> "- 1[12]/*/ppc**"; cleanup
# 2010-07-26 secondary: "- **/s390x/**" "- releases/test/12-Alpha" "- releases/test/9-Beta"
# 2010-08-25 secondary: "- releases/13/Everything/mips"
# 2011-04-20 "- /10/**" -> "- /1[03]/**"; + "- test/15-Alpha**"
# 2011-05-24 releases: "- test/1[34]-**" -> "- test/1[345]-**"
# 2011-06-09 secondary: + "- releases/1[13]/"
# 2011-06-22 secondary: + "- **/s390/**"
# 2011-06-23 secondary: "- releases/test/12-[AB]**" -> "- releases/test/12-Alpha"; + "- development/12"
# 2011-09-12 secondary: - "- **/ia64/**" "- **/arm/**" "- **/source/iso**" "- **/s390x/**" "- **/s390/**" "- releases/test/12-[AB]**" "- releases/test/9-Beta" "- releases/13/Everything/mips" "- releases/1[13]/" "- development/12"; releases: - "- /9/**" "- /1[03]/**" "- test/1[345]-**" "- test/15-Alpha**" "- 1[12]/*/ppc**"; updates: - "- /9/**" "- /10/**" "- testing/9/**" "- testing/10/**"; +enterpise; +beta
# 2011-11-17 - options="-varSH --partial --delete --delete-after --delete-excluded" rsync="/usr/bin/rsync" gap=2 #h  cos now there are dafaults
# 2011-12-06 oracle-linux
# 2012-03-01 download.fedora.redhat.com -> dl.fedoraproject.org was due since some 10 days!
# 2014-01-15 +rsync://be.mirror.eurid.eu/scientific/ (rsync://ftp.scientificlinux.org/scientific/ does not work correctly)
# 2014-05-15 /packages -> $p
# 2015-06-25 include linux-centos; rename: linux-fedora -> linux-redhat; 5/day from cron -> add 2 h gap; 06-26 +linux-elrepo, reordering
# 2015-10-20 +rsync://dl.fedoraproject.org/fedora-alt/
# 2015-11-20 rsync://ftp.nluug.nl/elrepo/ -> rsync://mirror.imt-systems.com/elrepo/ (Akemi Yagi <toracat@elrepo.org>)
# 2016-06-02 +rsync://eu-msync.centos.org/altarch/
# 2017-03-10 temporary limit for Fedora Sec.
# 2018-01-30 linux-rhel-enterprise + linux-rhel-beta + linux-rhel-beta-bits (empty) + everything else there -> linux-rhel
# 2020-02-21 linux-slc: "- /archive" "- **~tmp~**"; 09-27 rsync://mirror.imt-systems.com/elrepo -> rsync://mirrors.coreix.net/mirrors/elrepo/. (not http://mirrors.coreix.net/elrepo/ !)
# 2020-10-22 dl.fedoraproject.org and secondary.fedoraproject.org dead, ->ftp-stud.hs-esslingen.de; mirrors.ircam.fr half-dead, used rsync://fr2.rpmfind.net/linux/dag, linux-caos & rpm.old off; 10-25 epel & alt -> quick-fedora-mirror; 11-10 incomplete rsync://ftp.nluug.nl/scientific/ -> rsync://ftp.halifax.rwth-aachen.de/scientificlinux/
# 2021-05-02 -rsync://zeniv.linux.org.uk/distributions/enterprise - dead; 05-03 +rsync://ftp5.gwdg.de/pub/linux/rocky; 07-12 +rsync://ftp5.gwdg.de/pub/linux/almalinux/
# TODO: 
. /local/scripts/mirror/mirror-functions

gap=6 #h
mirror	rsync://ftp5.gwdg.de/pub/linux/rocky/				$p/linux-rocky			# 1
mirror	rsync://ftp5.gwdg.de/pub/linux/almalinux/			$p/linux-almalinux		# 2

gap=6 #h	not to large?
mirror	rsync://eu-msync.centos.org/CentOS/				$p/linux-centos			# 2
mirror	rsync://eu-msync.centos.org/altarch/				$p/linux-centos-altarch		# 3

gap=24 #h
mirror	rsync://mirror.nsc.liu.se/centos-store/				$p/linux-centos-vault		"- [2-6]*" "- altarch" "- centos"

gap=3 #h
repeatonerror=3
###mirror	rsync://rsync.scientificlinux.org/scientific/			$p/linux-scientificlinux	# 4
#mirror	rsync://ftp.nluug.nl/scientific/				$p/linux-scientificlinux	"- obsolete/" "- 5*"
mirror	rsync://ftp.halifax.rwth-aachen.de/scientificlinux/		$p/linux-scientificlinux	"- obsolete/" "- 5*" "- **~tmp~**"

gap=2 #h
# 20070917 brakowalo!
#mirror	rsync://dl.fedoraproject.org/fedora-linux-updates		$p/linux-fedora/linux/updates
##mirror	rsync://ftp-stud.hs-esslingen.de/fedora-linux-updates		$p/linux-fedora/linux/updates	"- **~tmp~**"

gap=6 #h
# 20080626 nowy mirror
#mirror	rsync://dl.fedoraproject.org/fedora-epel			$p/linux-fedora/linux/epel
##mirror	rsync://ftp-stud.hs-esslingen.de/fedora-epel			$p/linux-fedora-epel

gap=3 #h
mirror	rsync://mirrors.coreix.net/mirrors/elrepo/.			$p/linux-elrepo/.		# 9

gap=12 #h
repeatonerror=0
#mirror	rsync://dl.fedoraproject.org/fedora-linux-releases		$p/linux-fedora/linux/releases	"- test/32_Beta"
##mirror	rsync://ftp-stud.hs-esslingen.de/fedora-linux-releases		$p/linux-fedora/linux/releases	"- **~tmp~**"	"- test/32_Beta"
repeatonerror=3

gap=3 #h
#mirror	rsync://dl.fedoraproject.org/fedora-linux-development		$p/linux-fedora/linux/development
##mirror	rsync://ftp-stud.hs-esslingen.de/fedora-linux-development	$p/linux-fedora/linux/development	"- **~tmp~**"

# 20081031 secondary!; # 20090318 +releases; updates development releases -> all; # 20090417 settable time gap; 2017-05-19 -"- linux-fedora-secondary/releases/2[234]"
gap=6 #h
#mirror	rsync://secondary.fedoraproject.org/fedora-secondary		$p/linux-fedora-secondary	"- releases/test/32_Beta"
##mirror	rsync://ftp-stud.hs-esslingen.de/fedora-secondary		$p/linux-fedora-secondary	"- **~tmp~**"	"- releases/test/32_Beta"

gap=12 #h
mirror	rsync://linuxsoft.cern.ch/slc/					$p/linux-slc			"- /archive"	"- **~tmp~**"	"- slc5[2-9]*"	"- slc510**" "- updates/slc5X**"	"- slc6[02-9]" "- slc60*" "- slc61/"	"- /centos**"	"- /slc510/i386/SL/.k3b-0.12.17-3.el5.i386.rpm.mJYrae" "- /slc510/i386/SL/.openoffice.org-langpack-ts_ZA-3.1.1-19.5.el5_5.6.i386.rpm.SZtLgS" "- /slc59/i386/SL/.k3b-0.12.17-3.el5.i386.rpm.mJYrae" "- /slc59/i386/SL/.openoffice.org-langpack-ts_ZA-3.1.1-19.5.el5_5.6.i386.rpm.SZtLgS" "- /slc610/i386/SLC/.discinfo" "- /slc610/i386/SLC/.treeinfo" "- /slc62/i386/SLC/.discinfo" "- /slc62/i386/SLC/.treeinfo" "- /slc63/i386/SLC/.discinfo" "- /slc63/i386/SLC/.treeinfo" "- /slc63/i386nonpae/SLC/.discinfo" "- /slc63/i386nonpae/SLC/.treeinfo" "- /slc64/i386/SLC/.discinfo" "- /slc64/i386/SLC/.treeinfo" "- /slc65/i386/SLC/.discinfo" "- /slc65/i386/SLC/.treeinfo" "- /slc65/i386nonpae/SLC/.discinfo" "- /slc65/i386nonpae/SLC/.treeinfo" "- /slc66/i386/SLC/.discinfo" "- /slc66/i386/SLC/.treeinfo" "- /slc66/i386nonpae/SLC/.discinfo" "- /slc66/i386nonpae/SLC/.treeinfo" "- /slc67/i386/SLC/.discinfo" "- /slc67/i386/SLC/.treeinfo" "- /slc67/i386nonpae/SLC/.discinfo" "- /slc67/i386nonpae/SLC/.treeinfo" "- /slc68/i386/SLC/.discinfo" "- /slc68/i386/SLC/.treeinfo" "- /slc68/i386nonpae/SLC/.discinfo" "- /slc68/i386nonpae/SLC/.treeinfo" "- /slc69/i386/SLC/.discinfo" "- /slc69/i386/SLC/.treeinfo"	"- /updates/slc6X/i386/debug/thunderbird-debuginfo-68.12.0-1.el6_10.i686.rpm"	"- /internal"

gap=21 #h
#mirror	rsync://zeniv.linux.org.uk/distributions/enterprise/		$p/linux-oracle-linux		# 

gap=21 #h
mirror	rsync://ftp.redhat.com/redhat/					$p/linux-rhel			# 15

#mirror	rsync://dl.fedoraproject.org/fedora-alt/			$p/linux-fedora-alt		"- stage/29*"	"- stage/3[0-1]*"	"- 32_Beta-1.2"	"- 32_RC-1.[2-6]"
##mirror	rsync://ftp-stud.hs-esslingen.de/fedora-alt/			$p/linux-fedora-alt		"- **~tmp~**"	"- stage/29*" "- stage/3[0-1]*" "- 32_Beta-1.2" "- 32_RC-1.[2-6]"

#mirror	rsync://mirrors.ircam.fr/pub/dag/				$p/linux-dag
mirror	rsync://fr2.rpmfind.net/linux/dag				$p/linux-dag

gap=48 #h
#mirror	rsync://mirrors.ircam.fr/pub/caosity/				$p/linux-caos

#mirror	rsync://mirrors.ircam.fr/pub/rpm/				$p/rpm.old
mirror	rsync://rsync.osuosl.org/rpm/					$p/rpm				# 20
