turns out we had 2 syncs going on and the scripts needed cleaning. I have made a special file for centos downloads only and will let someone look at whether the other files are still needed

This commit is contained in:
Stephen Smoogen 2021-10-04 08:47:14 -04:00
parent c6f0ec6ed5
commit 19e0a22da1
7 changed files with 67 additions and 33 deletions

View file

@ -2,4 +2,4 @@
MAILTO=root@fedoraproject.org
*/10 * * * * root flock -n -E0 /tmp/download-sync -c '/root/quick-fedora-mirror/quick-fedora-mirror -c /root/quick-fedora-mirror.conf'
## Need to run this to keep centos mirror up to date.
00 11,23 * * * root /usr/local/bin/lock-wrapper sync-up-downloads "/usr/local/bin/sync-up-downloads"
00 1,7,13,19 * * * root /usr/local/bin/lock-wrapper sync-up-downloads "/usr/local/bin/sync-up-centos"

View file

@ -1,2 +1,4 @@
# Run quick mirror fedora every 10minutes
*/10 * * * * root flock -n -E0 /tmp/download-sync -c '/root/quick-fedora-mirror/quick-fedora-mirror -c /root/quick-fedora-mirror/quick-fedora-mirror.conf'
## Need to run this to keep centos mirror up to date.
00 1,7,13,19 * * * root /usr/local/bin/lock-wrapper sync-up-downloads "/usr/local/bin/sync-up-centos"

View file

@ -0,0 +1,28 @@
#!/bin/bash
##
## This script is used to sync data from main download servers to
## secondary server at RDU community cage.
##
RSYNC='/usr/bin/rsync'
RS_OPT="-avSHP --numeric-ids --log-file=/var/log/rsync-update.log"
RS_DEADLY="--delete --delete-excluded --delete-delay --delay-updates"
EPL_EXCLUDES=""
FED_EXCLUDES=""
# CentOS
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/centos/ /srv/pub/centos/ | tail -n2 | logger -p local0.notice -t rsync_centos
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS"
fi
# CentOS-altarch
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/altarch/ /srv/pub/centos-altarch/ | tail -n2 | logger -p local0.notice -t rsync_centos_alt
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-altarch"
fi
${RSYNC} ${RS_OPT} ${RS_DEADLY} rsync.stream.centos.org::CentOS-Stream-All/ /srv/pub/centos-stream/ | tail -n2 | logger -p local0.notice -t rsync_centos_stream
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-stream"
fi

View file

@ -0,0 +1,28 @@
#!/bin/bash
##
## This script is used to sync data from main download servers to
## secondary server at ibiblio.
##
RSYNC='/usr/bin/rsync'
RS_OPT="-avSHP --numeric-ids --log-file=/var/log/rsync-update.log"
RS_DEADLY="--delete --delete-excluded --delete-delay --delay-updates"
EPL_EXCLUDES=""
FED_EXCLUDES=""
# CentOS
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/centos/ /srv/pub/centos/ | tail -n2 | logger -p local0.notice -t rsync_centos
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS"
fi
# CentOS-altarch
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/altarch/ /srv/pub/centos-altarch/ | tail -n2 | logger -p local0.notice -t rsync_centos_alt
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-altarch"
fi
${RSYNC} ${RS_OPT} ${RS_DEADLY} rsync.stream.centos.org::CentOS-Stream-All/ /srv/pub/centos-stream/ | tail -n2 | logger -p local0.notice -t rsync_centos_stream
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-stream"
fi

View file

@ -30,21 +30,6 @@ if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to fedora-secondary"
fi
# CentOS
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/centos/ /srv/pub/centos/ | tail -n2 | logger -p local0.notice -t rsync_centos
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS"
fi
# CentOS-altarch
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/altarch/ /srv/pub/centos-altarch/ | tail -n2 | logger -p local0.notice -t rsync_centos_alt
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-altarch"
fi
${RSYNC} ${RS_OPT} ${RS_DEADLY} rsync.stream.centos.org::CentOS-Stream-All/ /srv/pub/centos-stream/ | tail -n2 | logger -p local0.notice -t rsync_centos_stream
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-stream"
fi
# Let MM know I'm all up to date
#/usr/bin/report_mirror

View file

@ -61,21 +61,6 @@ sync_stuff ${DATE_ARCHIVE} rsync_archive fedora-archive0 /srv/pub/archive/ "-f"
sync_stuff ${DATE_ALT} rsync_alt fedora-alt0 /srv/pub/alt/ "-f"
sync_stuff ${DATE_SECOND} rsync_second fedora-secondary0 /srv/pub/fedora-secondary/ "-f"
# CentOS
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/centos/ /srv/pub/centos/ | tail -n2 | logger -p local0.notice -t rsync_centos
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS"
fi
# CentOS-altarch
${RSYNC} ${RS_OPT} ${RS_DEADLY} master-1.centos.org::CentOS-community-cage/altarch/ /srv/pub/centos-altarch/ | tail -n2 | logger -p local0.notice -t rsync_centos_alt
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-altarch"
fi
${RSYNC} ${RS_OPT} ${RS_DEADLY} rsync.stream.centos.org::CentOS-Stream-All/ /srv/pub/centos-stream/ | tail -n2 | logger -p local0.notice -t rsync_centos_stream
if [[ $? -ne 0 ]]; then
echo "Unable to finish sync to CentOS-stream"
fi
# Let MM know I'm all up to date
#/usr/bin/report_mirror

View file

@ -50,12 +50,15 @@
tasks:
- import_tasks: "{{ tasks_path }}/motd.yml"
- name: put in script for syncing on download-ib01
- name: put in script for syncing fedora on download-ib01
copy: src="{{ files }}/download/sync-up-downloads.sh.ib01" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in script for syncing on download-ib01
- name: put in script for syncing fedora-alt on download-ib01
copy: src="{{ files }}/download/sync-up-other.sh.ib01" dest=/usr/local/bin/sync-up-other owner=root group=root mode=755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in script for syncing centos on download-ib01
copy: src="{{ files }}/download/sync-up-centos.sh.ib01" dest=/usr/local/bin/sync-up-centos owner=root group=root mode=755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in cron job for syncing
copy: src="{{ files }}/download/download-sync.cron.ib01" dest=/etc/cron.d/download-sync owner=root group=root mode=644
when: inventory_hostname == 'download-ib01.fedoraproject.org'
@ -69,6 +72,9 @@
- name: put in script for syncing on download-cc-rdu01
copy: src="{{ files }}/download/sync-up-downloads.sh.cc-rdu01" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755
when: inventory_hostname == 'download-cc-rdu01.fedoraproject.org'
- name: put in script for syncing centos on download-cc-rdu01
copy: src="{{ files }}/download/sync-up-centos.sh.ib01" dest=/usr/local/bin/sync-up-centos owner=root group=root mode=755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in cron job for syncing on download-cc-rdu01
copy: src="{{ files }}/download/download-sync.cron.cc-rdu01" dest=/etc/cron.d/download-sync owner=root group=root mode=644
when: inventory_hostname == 'download-cc-rdu01.fedoraproject.org'