From 2ffe423ca28c950c943446d8ebdda03d6978efd7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Jan 2025 12:12:35 +0100 Subject: mirrorsync: comment + check for dest directory --- mirrorsync | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mirrorsync b/mirrorsync index 083b758..2ceb9d1 100644 --- a/mirrorsync +++ b/mirrorsync @@ -49,6 +49,8 @@ src="rsync://rpms.remirepo.net" # Your local path. Change to whatever fits your system. dst=/mnt/RepoSync # $mirrormodule is also used in syslog output. +# ${dst}/${mirrormodule}/enterprise MUST exists +# ${dst}/${mirrormodule}/fedora MUST exists mirrormodule="Remi" # You can change v to q if you do not want detailed logging # You may also add additional excludes if you don't want to provide certain @@ -76,6 +78,14 @@ rsync_run(){ fi; } +if [ ! -d ${dst1} ]; then + echo "${dst1} directory does not exist" + exit 1 +fi +if [ ! -d ${dst2} ]; then + echo "${dst2} directory does not exist" + exit 1 +fi # Always pull the index.html to ensure the latest. curl/wget would still use same bandiwdth to check if the page changed even # if we aren't going to save a new copy wget https://rpms.remirepo.net/index.html -O ${dst}/${mirrormodule}/index.html >> "$logfile" 2>&1 -- cgit