not sure what this is

This commit is contained in:
root@saturn committed 2022-06-08 22:13:06 +02:00
1 parent 8dbb1d90fc
commit 2437b135ff
3 files changed
+17 -7

No files matched your search

+8 -2
View File
@@ -9,7 +9,7 @@ fatal() {
exit 1 exit 1
} }
home="/store" home="/store2"
target="${home}/mirror/archlinux" target="${home}/mirror/archlinux"
tmp="${home}/tmp" tmp="${home}/tmp"
lock='/tmp/mirrorsync.lck' lock='/tmp/mirrorsync.lck'
@@ -45,6 +45,12 @@ else
"${target}" &>> $logfile || fatal "Failed to sync." "${target}" &>> $logfile || fatal "Failed to sync."
fi fi
echo "lastsync: $(date -d @$(cat ${target}/lastsync))" >> $logfile LAST_SYNC=$(cat ${target}/lastsync)
if [ -z "${LAST_SYNC}" ];then
LAST_SYNC_FORMATTED="UNKNOWN"
else
LAST_SYNC_FORMATTED="$(date -d @${LAST_SYNC})"
fi
echo "lastsync: ${LAST_SYNC_FORMATTED}" >> $logfile
+1 -2
View File
@@ -19,8 +19,7 @@ source='rsync://archive.raspbian.org/archive'
exec 9>"${lock}" exec 9>"${lock}"
flock -n 9 || exit flock -n 9 || exit
# only run rsync when there are changes rsync -rtlvHq --safe-links --delete-after --progress -h --timeout=600 --contimeout=60 -p \
rsync -rtlvH --safe-links --delete-after --progress -h --timeout=600 --contimeout=60 -p \
--delay-updates --no-motd \ --delay-updates --no-motd \
${source} \ ${source} \
"${target}" &>> $logfile || fatal "Failed to sync." "${target}" &>> $logfile || fatal "Failed to sync."
+8 -3
View File
@@ -12,18 +12,23 @@ warn() {
# Find a source mirror near you which supports rsync on # Find a source mirror near you which supports rsync on
# https://launchpad.net/ubuntu/+cdmirrors # https://launchpad.net/ubuntu/+cdmirrors
# rsync://<iso-country-code>.rsync.releases.ubuntu.com/releases should always work # rsync://<iso-country-code>.rsync.releases.ubuntu.com/releases should always work
#RSYNCSOURCE=rsync://se.rsync.releases.ubuntu.com/releases RSYNCSOURCE=rsync://se.rsync.releases.ubuntu.com/releases
#RSYNCSOURCE=rsync://ftp.uninett.no/ubuntu-iso #RSYNCSOURCE=rsync://ftp.uninett.no/ubuntu-iso
RSYNCSOURCE=rsync://ubuntu.uib.no/ubuntu-releases/ #RSYNCSOURCE=rsync://ubuntu.uib.no/ubuntu-releases/
# Define where you want the mirror-data to be on your mirror # Define where you want the mirror-data to be on your mirror
BASEDIR=/store/mirror/ubuntu/releases/ BASEDIR=/store2/mirror/ubuntu-releases/
if [ ! -d ${BASEDIR} ]; then if [ ! -d ${BASEDIR} ]; then
warn "${BASEDIR} does not exist yet, trying to create it..." warn "${BASEDIR} does not exist yet, trying to create it..."
mkdir -p ${BASEDIR} || fatal "Creation of ${BASEDIR} failed." mkdir -p ${BASEDIR} || fatal "Creation of ${BASEDIR} failed."
fi fi
#rsync -v --progress --stats --recursive --times --links --hard-links \
# --stats --delete-after \
# ${RSYNCSOURCE} ${BASEDIR}
rsync -q --recursive --times --links --hard-links \ rsync -q --recursive --times --links --hard-links \
--stats --delete-after \ --stats --delete-after \
${RSYNCSOURCE} ${BASEDIR} &>> /var/log/mirror/ubuntu_releases.log || fatal "Failed to rsync from ${RSYNCSOURCE}." ${RSYNCSOURCE} ${BASEDIR} &>> /var/log/mirror/ubuntu_releases.log || fatal "Failed to rsync from ${RSYNCSOURCE}."