diff --git a/config.example.sh b/config.example.sh index 5b0869d..26be8ca 100755 --- a/config.example.sh +++ b/config.example.sh @@ -31,6 +31,8 @@ IA_ITEM_DATE=$( date +"%Y-%m" ) # offload items to another rsync storage instead of uploading to IA OFFLOAD_TARGET="rsync://somewhere-far-away:portnum/module-name/directory/" +# it is also possible to create a list of targets and the offloader will pick one at random and retry others on failure +# simply comment out the line above and put all rsync target urls separated by newline in a file called "offload_targets" ############### # DIRECTORIES # diff --git a/offload-one b/offload-one index 002cea5..9c1c782 100755 --- a/offload-one +++ b/offload-one @@ -36,7 +36,7 @@ function mayicontinue { mayicontinue -if test -z "${OFFLOAD_TARGET}" && ! cat ./offload_targets 2> /dev/null | grep -E '^rsync://[^/]+/[^/]+'; then +if test -z "${OFFLOAD_TARGET}" && ! cat ./offload_targets 2> /dev/null | grep -qE '^rsync://[^/]+/[^/]+'; then echo "No valid offload target specified in OFFLOAD_TARGET environment variable or ./offload_targets file, aborting offload" sleep 30 exit 1 @@ -82,7 +82,7 @@ do continue fi echo "Offloading to ${_OFFLOAD_TARGET}/${ITEM}/" - rsync -r --progress --stats --no-owner --no-group --partial --partial-dir .rsync-tmp --no-compress --compress-level 0 "${UPLOADER_WORKING_DIR}/${ITEM}/" "${_OFFLOAD_TARGET}/${ITEM}/" + rsync -r --progress --stats --no-owner --no-group --partial --partial-dir .rsync-tmp --delay-updates --no-compress --compress-level 0 "${UPLOADER_WORKING_DIR}/${ITEM}/" "${_OFFLOAD_TARGET}/${ITEM}/" result=$? if [[ $result -ne 0 ]] then