not sure what this is
This commit is contained in:
1 parent
8dbb1d90fc
commit
2437b135ff
3 files changed
+17
-7
No files matched your search
+8
-2
@@ -9,7 +9,7 @@ fatal() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
home="/store"
|
||||
home="/store2"
|
||||
target="${home}/mirror/archlinux"
|
||||
tmp="${home}/tmp"
|
||||
lock='/tmp/mirrorsync.lck'
|
||||
@@ -45,6 +45,12 @@ else
|
||||
"${target}" &>> $logfile || fatal "Failed to sync."
|
||||
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
@@ -19,8 +19,7 @@ source='rsync://archive.raspbian.org/archive'
|
||||
exec 9>"${lock}"
|
||||
flock -n 9 || exit
|
||||
|
||||
# only run rsync when there are changes
|
||||
rsync -rtlvH --safe-links --delete-after --progress -h --timeout=600 --contimeout=60 -p \
|
||||
rsync -rtlvHq --safe-links --delete-after --progress -h --timeout=600 --contimeout=60 -p \
|
||||
--delay-updates --no-motd \
|
||||
${source} \
|
||||
"${target}" &>> $logfile || fatal "Failed to sync."
|
||||
|
||||
+8
-3
@@ -12,18 +12,23 @@ warn() {
|
||||
# Find a source mirror near you which supports rsync on
|
||||
# https://launchpad.net/ubuntu/+cdmirrors
|
||||
# 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://ubuntu.uib.no/ubuntu-releases/
|
||||
#RSYNCSOURCE=rsync://ubuntu.uib.no/ubuntu-releases/
|
||||
|
||||
# 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
|
||||
warn "${BASEDIR} does not exist yet, trying to create it..."
|
||||
mkdir -p ${BASEDIR} || fatal "Creation of ${BASEDIR} failed."
|
||||
fi
|
||||
|
||||
#rsync -v --progress --stats --recursive --times --links --hard-links \
|
||||
# --stats --delete-after \
|
||||
# ${RSYNCSOURCE} ${BASEDIR}
|
||||
|
||||
|
||||
rsync -q --recursive --times --links --hard-links \
|
||||
--stats --delete-after \
|
||||
${RSYNCSOURCE} ${BASEDIR} &>> /var/log/mirror/ubuntu_releases.log || fatal "Failed to rsync from ${RSYNCSOURCE}."
|
||||
|
||||
Reference in new issue
Block a user