From 8d55281b858f0eee082e93b81f1de76dfff96ad9 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Mon, 11 Nov 2019 19:43:32 +0100 Subject: [PATCH] removed mirror scripts; mirror files will get an own repository --- .gitignore | 5 ---- bin/alpine.sh | 28 ------------------ bin/arch.sh | 77 ------------------------------------------------ bin/artix.sh | 7 ----- bin/blackarch.sh | 4 --- bin/fdroid.sh | 4 --- 6 files changed, 125 deletions(-) delete mode 100755 bin/alpine.sh delete mode 100755 bin/arch.sh delete mode 100755 bin/artix.sh delete mode 100755 bin/blackarch.sh delete mode 100755 bin/fdroid.sh diff --git a/.gitignore b/.gitignore index 279f52e5..5091b3a5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,7 @@ !bin #!bin/** !bin/ac.sh -!bin/alpine.sh -!bin/arch.sh -!bin/artix.sh -!bin/blackarch.sh !bin/eagle.sh -!bin/fdroid.sh !bin/forksync.sh !bin/gnucash.sh !bin/hanez.org.sh diff --git a/bin/alpine.sh b/bin/alpine.sh deleted file mode 100755 index 98dc6c86..00000000 --- a/bin/alpine.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env sh - -# make sure we never run 2 rsync at the same time -lockfile="/tmp/alpine-mirror.lock" -if [ -z "$flock" ] ; then - exec env flock=1 flock -n $lockfile "$0" "$@" -fi - -src=rsync://rsync.alpinelinux.org/alpine/ -dest=/data/alpine/ - -# uncomment this to exclude old v2.x branches -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 aarch64/ --exclude armhf/ --exclude armv7/ --exclude ppc64le/ --exclude s390x/ --exclude x86/" - -mkdir -p "$dest" -/usr/bin/rsync \ - --archive \ - --update \ - --hard-links \ - --delete \ - --delete-after \ - --delay-updates \ - --timeout=600 \ - --delete-excluded \ - --verbose \ - $exclude \ - "$src" "$dest" - diff --git a/bin/arch.sh b/bin/arch.sh deleted file mode 100755 index 65232ead..00000000 --- a/bin/arch.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bash - -# This is a simple mirroring script. To save bandwidth it first checks a -# timestamp via HTTP and only runs rsync when the timestamp differs from the -# local copy. As of 2016, a single rsync run without changes transfers roughly -# 6MiB of data which adds up to roughly 250GiB of traffic per month when rsync -# is run every minute. Performing a simple check via HTTP first can thus save a -# lot of traffic. - -# Directory where the repo is stored locally. Example: /srv/repo -target="/data/arch" - -# Directory where files are downloaded to before being moved in place. -# This should be on the same filesystem as $target, but not a subdirectory of $target. -# Example: /srv/tmp -tmp="/data/tmp" - -# Lockfile path -lock="/tmp/syncrepo.lck" - -# If you want to limit the bandwidth used by rsync set this. -# Use 0 to disable the limit. -# The default unit is KiB (see man rsync /--bwlimit for more) -bwlimit=0 - -# The source URL of the mirror you want to sync from. -# If you are a tier 1 mirror use rsync.archlinux.org, for example like this: -# rsync://rsync.archlinux.org/ftp_tier1 -# Otherwise chose a tier 1 mirror from this list and use its rsync URL: -# https://www.archlinux.org/mirrors/ -source_url='rsync://mirror.23media.de/archlinux/' - -# An HTTP(S) URL pointing to the 'lastupdate' file on your chosen mirror. -# If you are a tier 1 mirror use: http://rsync.archlinux.org/lastupdate -# Otherwise use the HTTP(S) URL from your chosen mirror. -lastupdate_url='http://mirror.23media.de/archlinux/lastupdate' - -#### END CONFIG - -[ ! -d "${target}" ] && mkdir -p "${target}" -[ ! -d "${tmp}" ] && mkdir -p "${tmp}" - -exec 9>"${lock}" -flock -n 9 || exit - -rsync_cmd() { - local -a cmd=(rsync -rtlH --safe-links --delete-after ${VERBOSE} "--timeout=600" "--contimeout=60" -p \ - --delay-updates --no-motd "--temp-dir=${tmp}") - - if stty &>/dev/null; then - cmd+=(-h -v --progress) - else - cmd+=(--quiet) - fi - - if ((bwlimit>0)); then - cmd+=("--bwlimit=$bwlimit") - fi - - "${cmd[@]}" "$@" -} - - -# if we are called without a tty (cronjob) only run when there are changes -if ! tty -s && [[ -f "$target/lastupdate" ]] && diff -b <(curl -Ls "$lastupdate_url") "$target/lastupdate" >/dev/null; then - # keep lastsync file in sync for statistics generated by the Arch Linux website - rsync_cmd "$source_url/lastsync" "$target/lastsync" - exit 0 -fi - -rsync_cmd \ - --exclude='*.links.tar.gz*' \ - --exclude='/other' \ - --exclude='/sources' \ - "${source_url}" \ - "${target}" - diff --git a/bin/artix.sh b/bin/artix.sh deleted file mode 100755 index a07a872d..00000000 --- a/bin/artix.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -rsync -auvPH --delete-after "rsync://mirrors.dotsrc.org/artix-linux/" /data/artix/ - -#rsync -auvPH --delete-after "rsync://orion.artixlinux.org:64873/" /data/artix/repos/ -#rsync -auvPH --delete-after "rsync://download.artixlinux.org/iso/" /data/artix/iso/ - diff --git a/bin/blackarch.sh b/bin/blackarch.sh deleted file mode 100755 index 4b96b044..00000000 --- a/bin/blackarch.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rsync -auvPH --delete-after "rsync://ftp.halifax.rwth-aachen.de/blackarch/" /data/blackarch/ - diff --git a/bin/fdroid.sh b/bin/fdroid.sh deleted file mode 100755 index e992520a..00000000 --- a/bin/fdroid.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rsync -auvPH --delete-after "rsync://rsync.cyberbits.eu/fdroid/" /data/fdroid/ -