Browse Source

Adding optional args

expose_links
Drew Short 5 years ago
parent
commit
545b60db8e
  1. 1
      README.md
  2. 1
      assets/common.sh
  3. 6
      assets/out

1
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

1
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

6
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

Loading…
Cancel
Save