2 # this can help you create/update your fedora mirror
7 root=/data/fedora/linux
8 rsyncurl=rsync://mirrors.kernel.org/fedora
9 #rsyncurl=rsync://fr.rpmfind.net/linux/fedora
15 echo "Usage: $COMMAND [-n] [-v] [-r root] [-u rsyncurl] [-f fcdistro] [-a arch]"
16 echo "Defaults to -r $root -u $rsyncurl -f $fcdistro -a $arch"
17 echo "Use vserver conventions for fcdistro, e.g. fc6 and f7"
21 while getopts "nvr:u:f:a:h" opt ; do
26 u) rsyncurl=$OPTARG ;;
27 f) fcdistro=$OPTARG ;;
35 findex=$(echo $fcdistro | sed -e s,fc,,g)
38 findex=$(echo $fcdistro | sed -e s,f,,g)
42 # manage LOG - beware it might be a symlink so nuke it first
43 LOG=$(mktemp /tmp/vserver-fedora-mirror-log.XXXX)
48 echo rsyncurl="$rsyncurl"
49 echo "fcdistro=$fcdistro"
55 echo "============================== $findex core"
56 mkdir -p ${root}/core/$findex/$arch/os/
57 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/$findex/$arch/os/ ${root}/core/$findex/$arch/os/
58 echo "============================== $findex updates"
59 mkdir -p ${root}/core/updates/$findex/$arch/
60 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
61 echo "============================== $findex extras"
62 mkdir -p ${root}/extras/$findex/$arch/
63 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/extras/$findex/$arch/ ${root}/extras/$findex/$arch/
67 echo "============================== $findex core"
68 mkdir -p ${root}/core/$findex/$arch/os/
69 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/$findex/Everything/$arch/os/ ${root}/core/$findex/$arch/os/
70 echo "============================== $findex updates"
71 mkdir -p ${root}/core/updates/$findex/$arch/
72 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
76 # somehow the layout on my favorite mirror is different in 7 and 8, /Everything/ has gone
77 echo "============================== $findex core"
78 mkdir -p ${root}/core/$findex/$arch/os/
79 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/$findex/$arch/os/ ${root}/core/$findex/$arch/os/
80 echo "============================== $findex updates"
81 mkdir -p ${root}/core/updates/$findex/$arch/
82 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
86 echo "Unknown fedora index $findex - exiting"