|
@ -82,6 +82,7 @@ for destination in $destinations; do |
|
|
rclone_link=$(_jq '.link // "false"') |
|
|
rclone_link=$(_jq '.link // "false"') |
|
|
rclone_link_find_filter=$(_jq '.linkFilter // "-maxdepth 1 -type f"') |
|
|
rclone_link_find_filter=$(_jq '.linkFilter // "-maxdepth 1 -type f"') |
|
|
rclone_allow_failure=$(_jq '.allowFailure // "false"') |
|
|
rclone_allow_failure=$(_jq '.allowFailure // "false"') |
|
|
|
|
|
rclone_sleep=$(_jq '.sleep // ""') |
|
|
|
|
|
|
|
|
echo "Destination: $rclone_destination" |
|
|
echo "Destination: $rclone_destination" |
|
|
echo "Destination subdir file: ${rclone_destination_subdir_file}" |
|
|
echo "Destination subdir file: ${rclone_destination_subdir_file}" |
|
@ -112,6 +113,9 @@ for destination in $destinations; do |
|
|
# shellcheck disable=2086 |
|
|
# shellcheck disable=2086 |
|
|
rclone ${rclone_command} "${rclone_source}" "${rclone_target}" --size-only --progress --stats=2s ${rclone_args} |
|
|
rclone ${rclone_command} "${rclone_source}" "${rclone_target}" --size-only --progress --stats=2s ${rclone_args} |
|
|
copy_rc=$? |
|
|
copy_rc=$? |
|
|
|
|
|
if [[ -n "${rclone_sleep}" ]]; then |
|
|
|
|
|
sleep ${rclone_sleep} |
|
|
|
|
|
fi |
|
|
if [[ "${rclone_allow_failure}" = "true" && $copy_rc -gt 0 ]]; then |
|
|
if [[ "${rclone_allow_failure}" = "true" && $copy_rc -gt 0 ]]; then |
|
|
echo "Rclone copy failed. Switching to next destination." |
|
|
echo "Rclone copy failed. Switching to next destination." |
|
|
continue |
|
|
continue |
|
@ -122,6 +126,9 @@ for destination in $destinations; do |
|
|
# shellcheck disable=2086 |
|
|
# shellcheck disable=2086 |
|
|
rclone dedupe --dedupe-mode "${rclone_dedupe_mode}" "${rclone_target}" --progress --stats=2s ${rclone_args} |
|
|
rclone dedupe --dedupe-mode "${rclone_dedupe_mode}" "${rclone_target}" --progress --stats=2s ${rclone_args} |
|
|
dedupe_rc=$? |
|
|
dedupe_rc=$? |
|
|
|
|
|
if [[ -n "${rclone_sleep}" ]]; then |
|
|
|
|
|
sleep ${rclone_sleep} |
|
|
|
|
|
fi |
|
|
if [[ "${rclone_allow_failure}" = "true" && $dedupe_rc -gt 0 ]]; then |
|
|
if [[ "${rclone_allow_failure}" = "true" && $dedupe_rc -gt 0 ]]; then |
|
|
echo "Rclone dedupe failed. Switching to next destination." |
|
|
echo "Rclone dedupe failed. Switching to next destination." |
|
|
continue |
|
|
continue |
|
@ -139,6 +146,9 @@ for destination in $destinations; do |
|
|
echo "Generating Link for: ${rclone_target_file}" |
|
|
echo "Generating Link for: ${rclone_target_file}" |
|
|
file_link=$(rclone link "${rclone_target_file}") |
|
|
file_link=$(rclone link "${rclone_target_file}") |
|
|
link_rc=$? |
|
|
link_rc=$? |
|
|
|
|
|
if [[ -n "${rclone_sleep}" ]]; then |
|
|
|
|
|
sleep ${rclone_sleep} |
|
|
|
|
|
fi |
|
|
if [[ "${rclone_allow_failure}" = "true" && $link_rc -gt 0 ]]; then |
|
|
if [[ "${rclone_allow_failure}" = "true" && $link_rc -gt 0 ]]; then |
|
|
echo "Rclone linking failed. Switching to next target." |
|
|
echo "Rclone linking failed. Switching to next target." |
|
|
continue |
|
|
continue |
|
@ -177,6 +187,9 @@ if (( ${#file_links[@]} )); then |
|
|
fi |
|
|
fi |
|
|
echo "Link Target: ${rclone_link_target}" |
|
|
echo "Link Target: ${rclone_link_target}" |
|
|
rclone copy ${links_json_file} ${rclone_link_target} --progress --stats=2s |
|
|
rclone copy ${links_json_file} ${rclone_link_target} --progress --stats=2s |
|
|
|
|
|
if [[ -n "${rclone_sleep}" ]]; then |
|
|
|
|
|
sleep ${rclone_sleep} |
|
|
|
|
|
fi |
|
|
fi |
|
|
fi |
|
|
cat "${links_json_file}" |
|
|
cat "${links_json_file}" |
|
|
jq -n "{ |
|
|
jq -n "{ |
|
|