2020-09-11 13:28:43 +02:00
|
|
|
#!/bin/bash
|
2020-09-11 13:47:13 +02:00
|
|
|
#
|
|
|
|
# This script syncs the entire repo to the primary mirrors. It is
|
|
|
|
# meant to run in a cronjob quite frequently, as often as there are
|
|
|
|
# files to send.
|
|
|
|
#
|
|
|
|
# This script expects the receiving side to have the following
|
|
|
|
# preceeding the ssh key entry in ~/.ssh/authorized_keys:
|
|
|
|
# command="rsync --server -logDtpre.iLsfx --log-format=X --delete --delay-updates . /path/to/htdocs/fdroid/",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty
|
|
|
|
#
|
2020-09-11 13:28:43 +02:00
|
|
|
set -e
|
|
|
|
(
|
|
|
|
flock -n 200
|
|
|
|
set -e
|
|
|
|
cd /home/fdroid
|
2020-09-11 13:47:13 +02:00
|
|
|
for section in repo archive; do
|
2020-09-17 11:43:16 +02:00
|
|
|
echo "Started $section at `date`:"
|
|
|
|
for host in fdroid@mirror.f-droid.org fdroid@ftp-push.lysator.liu.se; do
|
|
|
|
set -x
|
|
|
|
# be super careful with the trailing slashes here! if one is wrong, it'll delete the entire section!
|
|
|
|
rsync --archive --delay-updates --progress --delete \
|
|
|
|
/home/fdroid/public_html/${section} \
|
|
|
|
${host}:/srv/fdroid-mirror.at.or.at/htdocs/fdroid/ &
|
|
|
|
set +x
|
2020-09-11 13:47:13 +02:00
|
|
|
done
|
2020-09-17 11:43:16 +02:00
|
|
|
wait
|
2020-09-11 13:47:13 +02:00
|
|
|
done
|
2020-09-11 13:28:43 +02:00
|
|
|
) 200>/var/lock/root_fdroidmirrortomirror
|