From fee74120561f02274713878625c3e46197fc6492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Wed, 2 Jun 2021 23:33:51 +0200 Subject: [PATCH 01/15] Create mirrorsync.sh Initial version with simple locking and low stress rsyncing --- mirrorsync.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 mirrorsync.sh diff --git a/mirrorsync.sh b/mirrorsync.sh new file mode 100644 index 0000000..e054e39 --- /dev/null +++ b/mirrorsync.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# mirrorsync - Synchronize a Rocky mirror +# By: Dennis Koerner +# +# The latest version of this script can be found at: +# https://github.com/rocky-linux/rocky-tools +# +# Please read https://docs.rockylinux.org/en/rocky/8/guides/add_mirror_manager +# for further information on setting up a Rocky mirror. +# +# Copyright (c) 2021 Rocky Enterprise Software Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + + +RSYNC="/usr/bin/rsync" +# You can change v to q if you do not want detailed logging +OPTS="-vrlptDSH --exclude=*.~tmp~ --delete-delay --delay-updates" + +# Please use a mirror next to you for initial sync +# or if you are hosting a private rather than a pulic mirror. +# Local mirrors might be faster. +# Also we might restrict access to the master in the future. +# A complete list of mirrors can be found at +# https://mirrors.rockylinux.org/mirrormanager/mirrors/Rocky +SRC="msync.rockylinux.org::rocky/mirror/pub/rocky/" + +# Your local path. Change to whatever fits your system. +# MIRRORMODULE is also used in syslog output. +MIRRORMODULE="rocky-linux" +DST="/mnt/mirrorserver/${MIRRORMODULE}/" + +FILELISTFILE="/fullfiletimelist-rocky" +LOCKFILE=$0.lockfile + +CHECKRESULT=`${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}${FILELISTFILE}` +if [ -z $CHECKRESULT ]; then + echo "${FILELISTFILE} unchanged. Not updating at " `date` >> $0.log 2>&1 + logger -t rsync "Not updating ${MIRRORMODULE}: ${FILELISTFILE} unchanged." + exit 1 +fi + + +if [ -e $LOCKFILE ]; then + echo "Update already in progress at" `date` >> $0.log 2>&1 + logger -t rsync "Not updating ${MIRRORMODULE}: already in progress." +else + touch $LOCKFILE + echo "Started update at" `date` >> $0.log 2>&1 + logger -t rsync "Updating ${MIRRORMODULE}" + + ${RSYNC} ${OPTS} ${SRC} ${DST} >> $0.log 2>&1 + logger -t rsync "Finished updating ${MIRRORMODULE}" + echo "End: "`date` >> $0.log 2>&1 + rm $LOCKFILE +fi From b5d7170a04f7d810d89ba5129031ffb88e2d0806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 11:02:33 +0200 Subject: [PATCH 02/15] Update mirrorsync.sh --- mirrorsync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index e054e39..341018f 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/env bash # # mirrorsync - Synchronize a Rocky mirror # By: Dennis Koerner From 2c764f7532b1d548f80c0e7ba4dda0adaccc4f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 11:08:55 +0200 Subject: [PATCH 03/15] Update mirrorsync.sh Changed slashes path composition --- mirrorsync.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 341018f..223aae1 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -47,12 +47,12 @@ SRC="msync.rockylinux.org::rocky/mirror/pub/rocky/" # Your local path. Change to whatever fits your system. # MIRRORMODULE is also used in syslog output. MIRRORMODULE="rocky-linux" -DST="/mnt/mirrorserver/${MIRRORMODULE}/" +DST="/mnt/mirrorserver/${MIRRORMODULE}" -FILELISTFILE="/fullfiletimelist-rocky" +FILELISTFILE="fullfiletimelist-rocky" LOCKFILE=$0.lockfile -CHECKRESULT=`${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}${FILELISTFILE}` +CHECKRESULT=`${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}/${FILELISTFILE}` if [ -z $CHECKRESULT ]; then echo "${FILELISTFILE} unchanged. Not updating at " `date` >> $0.log 2>&1 logger -t rsync "Not updating ${MIRRORMODULE}: ${FILELISTFILE} unchanged." @@ -68,7 +68,7 @@ else echo "Started update at" `date` >> $0.log 2>&1 logger -t rsync "Updating ${MIRRORMODULE}" - ${RSYNC} ${OPTS} ${SRC} ${DST} >> $0.log 2>&1 + ${RSYNC} ${OPTS} ${SRC} ${DST}/ >> $0.log 2>&1 logger -t rsync "Finished updating ${MIRRORMODULE}" echo "End: "`date` >> $0.log 2>&1 rm $LOCKFILE From b8e86fbb1c8427d83a8bb66f06233f5e3ac6d033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 11:14:26 +0200 Subject: [PATCH 04/15] Update mirrorsync.sh Changed backticks to $() --- mirrorsync.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 223aae1..11257b2 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -52,24 +52,24 @@ DST="/mnt/mirrorserver/${MIRRORMODULE}" FILELISTFILE="fullfiletimelist-rocky" LOCKFILE=$0.lockfile -CHECKRESULT=`${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}/${FILELISTFILE}` +CHECKRESULT=$(${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}/${FILELISTFILE}) if [ -z $CHECKRESULT ]; then - echo "${FILELISTFILE} unchanged. Not updating at " `date` >> $0.log 2>&1 + echo "${FILELISTFILE} unchanged. Not updating at" $(date) >> $0.log 2>&1 logger -t rsync "Not updating ${MIRRORMODULE}: ${FILELISTFILE} unchanged." exit 1 fi if [ -e $LOCKFILE ]; then - echo "Update already in progress at" `date` >> $0.log 2>&1 + echo "Update already in progress at" $(date) >> $0.log 2>&1 logger -t rsync "Not updating ${MIRRORMODULE}: already in progress." else touch $LOCKFILE - echo "Started update at" `date` >> $0.log 2>&1 + echo "Started update at" $(date) >> $0.log 2>&1 logger -t rsync "Updating ${MIRRORMODULE}" ${RSYNC} ${OPTS} ${SRC} ${DST}/ >> $0.log 2>&1 logger -t rsync "Finished updating ${MIRRORMODULE}" - echo "End: "`date` >> $0.log 2>&1 + echo "End:" $(date) >> $0.log 2>&1 rm $LOCKFILE fi From 00a612503626b467fb9dbc86414150919480054d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 11:53:55 +0200 Subject: [PATCH 05/15] Update mirrorsync.sh Changed variable names to lowerspace Added doublequotes to variable usage Converted opts to an array Doublebrackets instead of [ ] Changed to printf instead of echo for logging Added force to rm --- mirrorsync.sh | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 11257b2..51da284 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -32,9 +32,9 @@ # -RSYNC="/usr/bin/rsync" +rsync="/usr/bin/rsync" # You can change v to q if you do not want detailed logging -OPTS="-vrlptDSH --exclude=*.~tmp~ --delete-delay --delay-updates" +opts=(-vrlptDSH --exclude=*.~tmp~ --delete-delay --delay-updates) # Please use a mirror next to you for initial sync # or if you are hosting a private rather than a pulic mirror. @@ -42,34 +42,35 @@ OPTS="-vrlptDSH --exclude=*.~tmp~ --delete-delay --delay-updates" # Also we might restrict access to the master in the future. # A complete list of mirrors can be found at # https://mirrors.rockylinux.org/mirrormanager/mirrors/Rocky -SRC="msync.rockylinux.org::rocky/mirror/pub/rocky/" +src="msync.rockylinux.org::rocky/mirror/pub/rocky" # Your local path. Change to whatever fits your system. -# MIRRORMODULE is also used in syslog output. -MIRRORMODULE="rocky-linux" -DST="/mnt/mirrorserver/${MIRRORMODULE}" +# $mirrormodule is also used in syslog output. +mirrormodule="rocky-linux" +dst="/mnt/mirrorserver/${mirrormodule}" -FILELISTFILE="fullfiletimelist-rocky" -LOCKFILE=$0.lockfile +filelistfile="fullfiletimelist-rocky" +lockfile="$0.lockfile" +logfile="$0.log" -CHECKRESULT=$(${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}/${FILELISTFILE}) -if [ -z $CHECKRESULT ]; then - echo "${FILELISTFILE} unchanged. Not updating at" $(date) >> $0.log 2>&1 - logger -t rsync "Not updating ${MIRRORMODULE}: ${FILELISTFILE} unchanged." +checkresult=$(${rsync} --no-motd --dry-run --out-format="%n" "${src}/${filelistfile}" "${dst}/${filelistfile}") +if [[ -z "$checkresult" ]]; then + printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1 + logger -t rsync "Not updating ${mirrormodule}: ${filelistfile} unchanged." exit 1 fi -if [ -e $LOCKFILE ]; then - echo "Update already in progress at" $(date) >> $0.log 2>&1 - logger -t rsync "Not updating ${MIRRORMODULE}: already in progress." +if [[ -e "$lockfile" ]]; then + printf "Update already in progress at %(%c)T\n" -1 >> "$logfile" 2>&1 + logger -t rsync "Not updating ${mirrormodule}: already in progress." else - touch $LOCKFILE - echo "Started update at" $(date) >> $0.log 2>&1 - logger -t rsync "Updating ${MIRRORMODULE}" + touch $lockfile + printf "Started update at %(%c)T\n" -1 >> "$logfile" 2>&1 + logger -t rsync "Updating ${mirrormodule}" - ${RSYNC} ${OPTS} ${SRC} ${DST}/ >> $0.log 2>&1 - logger -t rsync "Finished updating ${MIRRORMODULE}" - echo "End:" $(date) >> $0.log 2>&1 - rm $LOCKFILE + ${rsync} "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 + logger -t rsync "Finished updating ${mirrormodule}" + printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1 + rm -f $lockfile fi From f80797de04edf5a185a166869f8ca1493794db4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:25:32 +0200 Subject: [PATCH 06/15] Update mirrorsync.sh Added dead process check to file locking --- mirrorsync.sh | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 51da284..65262f0 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -53,6 +53,8 @@ filelistfile="fullfiletimelist-rocky" lockfile="$0.lockfile" logfile="$0.log" +# Check if the filelistfile has changed on upstream mirror +# and exit if it is still the same checkresult=$(${rsync} --no-motd --dry-run --out-format="%n" "${src}/${filelistfile}" "${dst}/${filelistfile}") if [[ -z "$checkresult" ]]; then printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1 @@ -60,17 +62,23 @@ if [[ -z "$checkresult" ]]; then exit 1 fi - -if [[ -e "$lockfile" ]]; then +# Check for existing lockfile to avoid multiple simultaneously running syncs +# If lockfile exists but process is dead continue anyway +if [[ -e "$lockfile" ]] && ! kill -0 "$(< "$lockfile")"; then + printf "Warning: lockfile exists but process dead, continuing.\n" >> "$logfile" 2>&1 + logger -t rsync "Warning: lockfile exists but process dead, continuing with updating ${mirrormodule}." + rm -f "$lockfile" +elif [[ -e "$lockfile" ]]; then printf "Update already in progress at %(%c)T\n" -1 >> "$logfile" 2>&1 logger -t rsync "Not updating ${mirrormodule}: already in progress." -else - touch $lockfile - printf "Started update at %(%c)T\n" -1 >> "$logfile" 2>&1 - logger -t rsync "Updating ${mirrormodule}" - - ${rsync} "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 - logger -t rsync "Finished updating ${mirrormodule}" - printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1 - rm -f $lockfile + exit 1 fi + +# The actual syncing part +printf '%s\n' "$$" > "$lockfile" +printf "Started update at %(%c)T\n" -1 >> "$logfile" 2>&1 +logger -t rsync "Updating ${mirrormodule}" +${rsync} "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 +logger -t rsync "Finished updating ${mirrormodule}" +printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1 +rm -f $lockfile From cddbf9fc58178f0ad21667b050bc88637d6d37ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:27:41 +0200 Subject: [PATCH 07/15] Update mirrorsync.sh Added quotes to --exclude parameter --- mirrorsync.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 65262f0..ee92aa9 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -34,7 +34,7 @@ rsync="/usr/bin/rsync" # You can change v to q if you do not want detailed logging -opts=(-vrlptDSH --exclude=*.~tmp~ --delete-delay --delay-updates) +opts=(-vrlptDSH --exclude="*.~tmp~" --delete-delay --delay-updates) # Please use a mirror next to you for initial sync # or if you are hosting a private rather than a pulic mirror. @@ -82,3 +82,4 @@ ${rsync} "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 logger -t rsync "Finished updating ${mirrormodule}" printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1 rm -f $lockfile + From 343a2269b2e98e7b2fb17b0a877157b9f5945a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:40:08 +0200 Subject: [PATCH 08/15] Update mirrorsync.sh Removed calling rsync by explicit path --- mirrorsync.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index ee92aa9..22f7d4b 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -32,7 +32,6 @@ # -rsync="/usr/bin/rsync" # You can change v to q if you do not want detailed logging opts=(-vrlptDSH --exclude="*.~tmp~" --delete-delay --delay-updates) @@ -55,7 +54,7 @@ logfile="$0.log" # Check if the filelistfile has changed on upstream mirror # and exit if it is still the same -checkresult=$(${rsync} --no-motd --dry-run --out-format="%n" "${src}/${filelistfile}" "${dst}/${filelistfile}") +checkresult=$(rsync --no-motd --dry-run --out-format="%n" "${src}/${filelistfile}" "${dst}/${filelistfile}") if [[ -z "$checkresult" ]]; then printf "%s unchanged. Not updating at %(%c)T\n" "$filelistfile" -1 >> "$logfile" 2>&1 logger -t rsync "Not updating ${mirrormodule}: ${filelistfile} unchanged." @@ -78,8 +77,7 @@ fi printf '%s\n' "$$" > "$lockfile" printf "Started update at %(%c)T\n" -1 >> "$logfile" 2>&1 logger -t rsync "Updating ${mirrormodule}" -${rsync} "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 +rsync "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 logger -t rsync "Finished updating ${mirrormodule}" printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1 rm -f $lockfile - From 06d824e9df6c3a4e8a371821c66eba906dc981cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:44:27 +0200 Subject: [PATCH 09/15] Update mirrorsync.sh Redirect stderr of kill to /dev/null --- mirrorsync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 22f7d4b..331508a 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -63,7 +63,7 @@ fi # Check for existing lockfile to avoid multiple simultaneously running syncs # If lockfile exists but process is dead continue anyway -if [[ -e "$lockfile" ]] && ! kill -0 "$(< "$lockfile")"; then +if [[ -e "$lockfile" ]] && ! kill -0 "$(< "$lockfile")" 2>/dev/null; then printf "Warning: lockfile exists but process dead, continuing.\n" >> "$logfile" 2>&1 logger -t rsync "Warning: lockfile exists but process dead, continuing with updating ${mirrormodule}." rm -f "$lockfile" From b3875ce3ded157a2f29742c0046e3184240b9e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:53:19 +0200 Subject: [PATCH 10/15] Update mirrorsync.sh --- mirrorsync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirrorsync.sh b/mirrorsync.sh index 331508a..ce11bed 100644 --- a/mirrorsync.sh +++ b/mirrorsync.sh @@ -80,4 +80,4 @@ logger -t rsync "Updating ${mirrormodule}" rsync "${opts[@]}" "${src}/" "${dst}/" >> "$logfile" 2>&1 logger -t rsync "Finished updating ${mirrormodule}" printf "End: %(%c)T\n" -1 >> "$logfile" 2>&1 -rm -f $lockfile +rm -f "$lockfile" From 7ee8e846fc58774e5e5347f26d9567da95828b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 13:25:03 +0200 Subject: [PATCH 11/15] Rename mirrorsync.sh to mirror/mirrorsync.sh --- mirrorsync.sh => mirror/mirrorsync.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mirrorsync.sh => mirror/mirrorsync.sh (100%) diff --git a/mirrorsync.sh b/mirror/mirrorsync.sh similarity index 100% rename from mirrorsync.sh rename to mirror/mirrorsync.sh From 15ed2e33ab1cc1bed35e6db43dc1fa927910d8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 13:59:05 +0200 Subject: [PATCH 12/15] Create README.md --- mirror/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 mirror/README.md diff --git a/mirror/README.md b/mirror/README.md new file mode 100644 index 0000000..9ec5223 --- /dev/null +++ b/mirror/README.md @@ -0,0 +1,10 @@ +Rocky Mirror Scripts +==================== + +Scripts and snippets for mirror admins. + +## mirrorsync.sh + +Example script for keeping a public or private mirror in sync. + +Please read https://docs.rockylinux.org/en/rocky/8/guides/add_mirror_manager for further information on setting up a Rocky mirror. From b9f58f2cdcf34045043f7472a855390b693c0c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 14:01:01 +0200 Subject: [PATCH 13/15] Create example.crontab --- mirror/example.crontab | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mirror/example.crontab diff --git a/mirror/example.crontab b/mirror/example.crontab new file mode 100644 index 0000000..2f463a2 --- /dev/null +++ b/mirror/example.crontab @@ -0,0 +1,9 @@ +#This will synchronize your mirror at 0:50, 4:50, 8:50, 12:50, 16:50, 20:50 +50 */6 * * * /path/to/your/rocky-rsync-mirror.sh > /dev/null 2>&1 + +#This will synchronize your mirror at 2:25, 6:25, 10:25, 14:25, 18:25, 22:25 +25 2,6,10,14,18,22 * * * /path/to/your/rocky-rsync-mirror.sh > /dev/null 2>&1 + +#This will synchronize your mirror every hour at 15 minutes past the hour. +#Only use if you are using our example script +15 * * * * /path/to/your/rocky-rsync-mirror.sh > /dev/null 2>&1 From fd3994bff450b8ccb08a6ebf13884703b12265fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 14:01:55 +0200 Subject: [PATCH 14/15] Update README.md --- mirror/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mirror/README.md b/mirror/README.md index 9ec5223..3ce6455 100644 --- a/mirror/README.md +++ b/mirror/README.md @@ -3,6 +3,10 @@ Rocky Mirror Scripts Scripts and snippets for mirror admins. +## example.crontab + +A few suggestions for setting up a crontab for syncing. + ## mirrorsync.sh Example script for keeping a public or private mirror in sync. From 77cc1be64a09064837a6885ff92e983795d3d1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20K=C3=B6rner?= <79668910+netzwergehh@users.noreply.github.com> Date: Thu, 3 Jun 2021 14:02:41 +0200 Subject: [PATCH 15/15] Update README.md --- mirror/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirror/README.md b/mirror/README.md index 3ce6455..ac4964d 100644 --- a/mirror/README.md +++ b/mirror/README.md @@ -3,6 +3,8 @@ Rocky Mirror Scripts Scripts and snippets for mirror admins. +Please read https://docs.rockylinux.org/en/rocky/8/guides/add_mirror_manager for further information on setting up a Rocky mirror. + ## example.crontab A few suggestions for setting up a crontab for syncing. @@ -10,5 +12,3 @@ A few suggestions for setting up a crontab for syncing. ## mirrorsync.sh Example script for keeping a public or private mirror in sync. - -Please read https://docs.rockylinux.org/en/rocky/8/guides/add_mirror_manager for further information on setting up a Rocky mirror.