Script to syncronize repos on PVE added

This commit is contained in:
Игорь Чудов 2019-10-04 15:06:50 +04:00
parent e062b82396
commit c0db3ed2f2
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

19
scripts/sync_alt_repo Normal file
View File

@ -0,0 +1,19 @@
#! /bin/sh
set -eu
MIRRORS_SRC="${MIRRORS_SRC:-ftp.altlinux.org}"
MIRRORS_DEST="${MIRRORS_DEST:-/data/mirrors/alt}"
PLATFORM="${PLATFORM:-p8}"
mkdir -p "${MIRRORS_DEST}/${PLATFORM}"
/usr/bin/rsync \
--timeout=6000 \
-avlpztc \
-P \
--stats \
--delete-after \
--exclude 'SRPMS*/' \
"rsync://${MIRRORS_SRC}/altlinux/${PLATFORM}/branch" \
"${MIRRORS_DEST}/${PLATFORM}/" > "${MIRRORS_DEST}/${PLATFORM}.log" 2>&1