mirrormanager: do not scan primary mirror if currently syncing
Signed-off-by: Adrian Reber <adrian@lisas.de>
This commit is contained in:
parent
c7fcf5ddb0
commit
bcb57d6ef4
2 changed files with 12 additions and 4 deletions
|
@ -18,8 +18,8 @@ MAILTO=root
|
|||
15 */2 * * * mirrormanager /usr/local/bin/umdl-required archive /var/log/mirrormanager/umdl-required.log
|
||||
45 */2 * * * mirrormanager /usr/local/bin/umdl-required alt /var/log/mirrormanager/umdl-required.log
|
||||
|
||||
# check if category CentOS needs updating every two hours
|
||||
33 */2 * * * mirrormanager /usr/local/bin/umdl-required centos /var/log/mirrormanager/umdl-required.log
|
||||
# check if category CentOS needs updating every 15 minutes
|
||||
57,12,27,42 * * * * mirrormanager /usr/local/bin/umdl-required centos /var/log/mirrormanager/umdl-required.log
|
||||
|
||||
# Sync netblocks list once a day
|
||||
30 0 * * * mirrormanager cd /usr/share/mirrormanager2 && /usr/bin/mm2_get_global_netblocks /var/lib/mirrormanager/global_netblocks.txt
|
||||
|
|
|
@ -46,9 +46,17 @@ else
|
|||
fi
|
||||
|
||||
if [ "${1}" == "centos" ]; then
|
||||
FFTL="http://centos-master01.iad2.fedoraproject.org/9-stream/COMPOSE_ID"
|
||||
CENTOS_PRIMARY="mref1-priv.iad2.centos.org"
|
||||
# check if a sync is currently in process
|
||||
CODE=$( curl -s -o /dev/null -I -w "%{http_code}" http://${CENTOS_PRIMARY}/9-stream/.sync_in_progress )
|
||||
if [ "${CODE}" -eq "200" ]; then
|
||||
echo -n "CentOS primary mirror sync in progress. Skipping scan at "
|
||||
date
|
||||
exit 0
|
||||
fi
|
||||
FFTL="http://${CENTOS_PRIMARY}/9-stream/COMPOSE_ID"
|
||||
FILEDATE=`date +%s -d"$( curl -s --head ${FFTL} | awk 'BEGIN {FS=": "}/^Last-Modified/{print $2}' )"`
|
||||
FFTL_SIGS="http://centos-master01.iad2.fedoraproject.org/SIGs/9-stream/COMPOSE_ID"
|
||||
FFTL_SIGS="http://${CENTOS_PRIMARY}/SIGs/9-stream/COMPOSE_ID"
|
||||
FILEDATE_SIGS=`date +%s -d"$( curl -s --head ${FFTL_SIGS} | awk 'BEGIN {FS=": "}/^Last-Modified/{print $2}' )"`
|
||||
if [ "$FILEDATE_SIGS" -gt "$FILEDATE" ]; then
|
||||
FILEDATE=$FILEDATE_SIGS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue