====== apt-mirror ====== ===== Summary ===== Serves as DEB and RPM repo mirrors. See [[https://apt-mirror.github.io/|apt-mirror's project page]] Lives on [[hardware:infrastructure#gitbuildercephcom|gitbuilder-archive]]. ===== apt-mirror.sh ===== Called by root's crontab every day at 4PM Pacific time. # cat /home/apt-mirror/apt-mirror.sh #!/bin/bash echo > /var/spool/apt-mirror/var/cron.log for file in /etc/apt/mirrors/*.list do cp -avf $file /etc/apt/mirror.list sleep 5 /usr/bin/apt-mirror >> /var/spool/apt-mirror/var/cron.log done ===== /bin/repomirror.sh ===== Called by root's crontab every day at 6PM Pacific time. root@gitbuilder-archive:~# cat /bin/repomirror.sh | egrep -v "(^#.*|^$)" tmp=/tmp/temprpm rm -Rf $tmp 2> /dev/null mkdir $tmp export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /usr/sbin/chroot /images/rhel7 < ===== Common Problems ===== ==== Hash checksum mismatch ==== This can happen when an upstream Ubuntu repo is modified while apt-mirror is running. Re-run apt-mirror.sh to resync the repos. This can also happen when there is an inconsistency in the upstream repo. See http://tracker.ceph.com/issues/15459 ===== Hacks ===== https://github.com/djgalloway/apt-mirror/commit/efebe269a8c2d6a776d337f82f70a9b434c1b186