3 # using fedora's mirrormanager (hence report_mirror)
5 # http://www.techrepublic.com/blog/linux-and-open-source/create-a-local-fedora-mirror-system-and-get-blazing-fast-updates/
7 current_versions="20 21 22"
8 upstream_url=rsync://mirror2.hs-esslingen.de/fedora/linux
11 fdest="/mirror/fedora"
12 # xxx not sure if useful
13 excludes_file=/mirror/fedora/fedora-excludes.txt
15 lock=".rsync_updates.lock"
18 # for safety - clear lock if older than 4 hours
20 is_old=$(find $lock -mmin +$GRACE 2> /dev/null)
21 if [ -n "$is_old" ] ; then
22 msg "$lock is older than $GRACE minutes - removing"
26 if [ -f ${lock} ]; then
27 echo "Updates via rsync already running."
31 for version in $current_versions; do
32 if [ ! -d ${fdest}/releases/${version}/Everything ]; then
33 echo "Target directory ${fdest}/${releases}/${version}/ not present."
36 echo "Synchronizing Fedora ${version}"
37 pushd ${fdest}/releases/${version} >& /dev/null
38 rsync -avH ${upstream_url}/releases/${version}/Everything . --exclude-from=${excludes_file} ${options} \
39 --numeric-ids --delete --delete-after --delay-updates
41 echo "Synchronizing Fedora updates for version ${version}"
42 pushd ${fdest}/updates/${version} >& /dev/null
43 rsync -avH ${upstream_url}/updates/${version}/ . --exclude-from=${excludes_file} ${options} \
44 --numeric-ids --delete --delete-after --delay-updates
48 # report to fedora's infra
49 /usr/bin/report_mirror