1 Apr 2020 |
costalfy__ | ça a l'air d'être le tronc commun https://wiki.archlinux.org/index.php/DeveloperWiki:NewMirrors#Mirror_size | 15:11:09 |
T0MuX | oh merde | 15:12:04 |
T0MuX | effectivement | 15:12:07 |
bobfett | et faire avec un cache ça ne serait pas mieux ? | 15:12:23 |
T0MuX | ChéPô | 15:15:25 |
T0MuX | magnifique :D | 15:19:00 |
T0MuX | costalfy__: je te montre mon script | 15:19:04 |
T0MuX | costalfy__:
#!/bin/bash
#
########
#
# Copyright © 2014-2019 Florian Pritz <bluewind@xinu.at>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
########
#
# 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="/volume1/repomux/manjaro"
# 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="/volume1/repomux/manjaro-tmp"
# Lockfile path
lock="/volume1/repomux/manjaro.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.yandex.ru/mirrors/manjaro'
# 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='https://mirror.yandex.ru/mirrors/manjaro/state'
# MANJARO SPECIFIC
# Let values to 0 if you do not use those branches.
staging=0 # stable-staging
testing=0
unstable=0
# Let value to 0 if you don't use aarch64 (only the x86_64 arch will be sync)
aarch64=0
#### 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
if [ $staging -eq 0 ]; then
cmd+=("--exclude=stable-staging")
fi
if [ $testing -eq 0 ]; then
cmd+=("--exclude=testing")
fi
if [ $unstable -eq 0 ]; then
cmd+=("--exclude=unstable")
fi
if [ $aarch64 -eq 0 ]; then
cmd+=("--exclude=aarch64")
cmd+=("--exclude=arm-testing")
cmd+=("--exclude=arm-unstable")
cmd+=("--exclude=arm-stable")
cmd+=("--exclude=overlay-arm")
cmd+=("--exclude=sync-arm")
fi
"${cmd[@]}" "$@"
}
# if we are called without a tty (cronjob) only run when there are changes
if ! tty -s && [[ -f "$target/state" ]] && diff -b <(curl -Ls "$lastupdate_url") "$target/state" >/dev/null; then
# keep lastsync file in sync for statistics generated by the Arch Linux website
rsync_cmd "$source_url/state" "$target/state"
exit 0
fi
rsync_cmd --exclude='*.links.tar.gz*' --exclude='/other' --exclude='/sources' --exclude='/iso' "${source_url}" "${target}"
#echo "Last sync was $(date -d @$(cat ${target}/lastsync))"
| 15:20:57 |
T0MuX | j'ai rajouté le bloc ### MANJARO SPECIFIC ### | 15:21:20 |
T0MuX | et les if à partir de $staging jusqu'à la fin | 15:21:43 |
T0MuX | et là j'ai viré : aarch64, tous les dossiers arm, et toutes les branches que je n'utilise pas 🙂 | 15:22:08 |
T0MuX | 47Go | 15:22:16 |
costalfy__ | Oô yandex.ru est plus rapide chez toi T0MuX ? | 15:23:52 |
T0MuX | costalfy__: oui, visiblement | 15:24:45 |
T0MuX | en tout cas c'est celui qui supporte rsync et qui est le plus rapide | 15:24:55 |
T0MuX | faut pas l'utiliser en journée quoi... | 15:25:01 |
T0MuX | je l'ai cron'd à 4h AM ça devrait aller | 15:25:14 |
T0MuX | et Archlinux à 5h | 15:25:18 |
T0MuX | tiens et ça c'est mon index.html du dépot | 15:25:33 |
T0MuX | <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
Ceci est un dépot local pour Archlinux et Manjaro Linux. À mettre dans mirrorlist :<br><br>
<table>
<tr>
<td><a href=./archlinux>Archlinux</a></td>
<td>http://192.168.1.250:8000/archlinux/$repo/os/$arch</td>
</tr>
<tr>
<td><a href=./manjaro>Manjaro</a></td>
<td>http://192.168.1.250:8000/manjaro/manjaro/stable/$repo/$arch</td>
</tr>
</table>
</body>
| 15:25:37 |
costalfy__ | merci... c'est cool de voir que mon article a servi a qlq'un ^^ | 15:29:15 |
T0MuX | bin carrément 🙂 quand j'ai vu ça j'ai sauté sur l'occasion | 15:31:19 |
T0MuX | je m'étais toujours demandé comment on fait un mirroir en plus | 15:31:30 |
T0MuX | c'était une occasion d'apprendre, et d'accélerer mes mises à jour en pratique | 15:31:46 |
T0MuX | surtout au moment ou moi je les demande | 15:32:01 |
T0MuX | et comme je disais, 90% de mes machines sont en archlinux ou manjaro, les 10% restant c'est une alpine et une archlinux32 | 15:32:26 |
3 Apr 2020 |
| @cequejevois:matrix.org joined the room. | 14:19:13 |
| @julie2819:matrix.org joined the room. | 15:53:09 |
@julie2819:matrix.org | Comment ça fonctionne? | 15:53:31 |
4 Apr 2020 |
| @julie2819:matrix.org left the room. | 03:34:47 |