diff options
Diffstat (limited to 'mirrorsync')
-rw-r--r-- | mirrorsync | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 @@ -129,7 +139,7 @@ if [[ -n "$checkresult2" ]]; then logger -t rsync "Succeed updating ${mirrormodule}" else logger -t rsync "Failed updating ${mirrormodule} see ${logfile}" - rm -f ${dst1}/${datefile} + rm -f ${dst2}/${datefile} fi fi |