diff --git a/README.md b/README.md index d26e18c..1151f1e 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ It's highly recommended to use secrets mangement to avoid storing sensitive cred * oldest * largest * rename +* `args`: Optional. An array of additional arguments to pass to rclone. #### Example diff --git a/assets/common.sh b/assets/common.sh index f93ba8f..a61ce85 100644 --- a/assets/common.sh +++ b/assets/common.sh @@ -3,6 +3,7 @@ export TMPDIR=${TMPDIR:-/tmp/rclone} mkdir -p "${TMPDIR}" load_config() { + mkdir -p "$TMPDIR/.config" RCLONE_CONFIG=$TMPDIR/.config/rclone_config export RCLONE_CONFIG diff --git a/assets/out b/assets/out index 5187ada..9ac1311 100644 --- a/assets/out +++ b/assets/out @@ -73,11 +73,13 @@ for destination in $destinations; do rclone_destination_subdir_file=$(_jq '.subdir // ""') rclone_dedupe=$(_jq '.dedupe // "false"') rclone_dedupe_mode=$(_jq '.dedupeMode // "newest"') + rclone_args=$(_jq '.args? | join(" ")') echo "Destination: $rclone_destination" echo "Destination subdir file: ${rclone_destination_subdir_file}" echo "Run dedupe: ${rclone_dedupe}" echo "Dedupe mode: ${rclone_dedupe_mode}" + echo "Additonal args: ${rclone_args}" rclone_destination_subdir="" if [ -n "$rclone_destination_subdir_file" ]; then @@ -87,11 +89,11 @@ for destination in $destinations; do rclone_target="${rclone_destination}/${rclone_destination_subdir}" echo "Target: ${rclone_target}" - rclone copy "${rclone_source}" "${rclone_target}" --size-only --progress --stats=2s + rclone copy "${rclone_source}" "${rclone_target}" --size-only --progress --stats=2s ${rclone_args} if [[ "$rclone_dedupe" == "true" ]]; then echo "Running Dedupe for: ${rclone_target}" - rclone dedupe --dedupe-mode "${rclone_dedupe_mode}" "${rclone_target}" + rclone dedupe --dedupe-mode "${rclone_dedupe_mode}" "${rclone_target}" ${rclone_args} fi done