Repository for all the scripts syncing my mirrors
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
914B

  1. #!/usr/bin/env sh
  2. # make sure we never run 2 rsync at the same time
  3. lockfile="/data/tmp/alpine-mirror.lock"
  4. if [ -z "$flock" ] ; then
  5. exec env flock=1 flock -n $lockfile "$0" "$@"
  6. fi
  7. src=rsync://rsync.alpinelinux.org/alpine/
  8. dest=/data/mirrors/alpine/
  9. # uncomment this to exclude old v2.x branches
  10. exclude="--exclude v2.* --exclude v3.0 --exclude v3.1 --exclude v3.2 --exclude v3.2 --exclude v3.3 --exclude v3.4 --exclude v3.5 --exclude v3.6 --exclude=v3.7 --exclude=v3.8 --exclude=v3.9 --exclude=v3.10 --exclude aarch64/ --exclude armhf/ --exclude armv7/ --exclude ppc64le/ --exclude s390x/ --exclude x86/ --delete-excluded"
  11. mkdir -p "$dest"
  12. /usr/bin/rsync \
  13. --archive \
  14. --update \
  15. --hard-links \
  16. --delete \
  17. --delete-after \
  18. --delay-updates \
  19. --timeout=600 \
  20. --delete-excluded \
  21. --verbose \
  22. $exclude \
  23. "$src" "$dest"