summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-01-22 12:12:35 +0100
committerRemi Collet <remi@php.net>2025-01-22 12:12:35 +0100
commit2ffe423ca28c950c943446d8ebdda03d6978efd7 (patch)
tree9c3e2ad84b20141659666229b5042b4f93839ad6
parentcd5f31eecef4f9b17f345e36923cce15c352a8eb (diff)
mirrorsync: comment + check for dest directoryHEADmaster
-rw-r--r--mirrorsync10
1 files changed, 10 insertions, 0 deletions
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