diff --git a/README.md b/README.md index 48e858d..17c9264 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ It's highly recommended to use secrets mangement to avoid storing sensitive cred * `destination`: Required. A list of destinations to copy files to. * `dir`: Required. A rclone destination for the files. ex. `remote:some/location` * `subdir`: Optional. A file that includes additional path information to be appended to the end of destination. + * `command`: Optional. The rclone command to run. Default `copy` + * copy (default) + * copyto (default) + * move + * sync + * `args`: Optional. An array of additional arguments to pass to rclone. * `dedupe`: Optional. Run `rsync dedupe` after syncing files. Default `false` * `dedupeMode`: Optional. The dedupe mode to use. Default `newest`. [rclone dedupe](https://rclone.org/commands/rclone_dedupe/) * skip @@ -71,9 +77,8 @@ It's highly recommended to use secrets mangement to avoid storing sensitive cred * rename * `link`: Optional. Create a link to the resource if possible. Default `false` * `linkFilter`: Optional. A find filter on the source directory for files to generate links to. Default `-maxdepth 1 -type f` - * `args`: Optional. An array of additional arguments to pass to rclone. * `allowFailure`: Optional. Allow this destination to fail without failing the job. Default `false` - + #### Example ```bash diff --git a/assets/out b/assets/out index bd84c54..e2ff90c 100644 --- a/assets/out +++ b/assets/out @@ -73,18 +73,20 @@ for destination in $destinations; do rclone_destination=$(_jq '.dir') rclone_destination_subdir_file=$(_jq '.subdir // ""') + rclone_command=$(_jq '.command // "copy"') + rclone_args=$(_jq '.args // [] | join(" ")') rclone_dedupe=$(_jq '.dedupe // "false"') rclone_dedupe_mode=$(_jq '.dedupeMode // "newest"') - rclone_args=$(_jq '.args // [] | join(" ")') rclone_link=$(_jq '.link // "false"') rclone_link_find_filter=$(_jq '.linkFilter // "-maxdepth 1 -type f"') rclone_allow_failure=$(_jq '.allowFailure // "false"') echo "Destination: $rclone_destination" echo "Destination subdir file: ${rclone_destination_subdir_file}" + echo "Command: ${rclone_command}" + echo "Additonal args: ${rclone_args}" echo "Run dedupe: ${rclone_dedupe}" echo "Dedupe mode: ${rclone_dedupe_mode}" - echo "Additonal args: ${rclone_args}" echo "Generate link: ${rclone_link}" echo "Link find filter: ${rclone_link_find_filter}" echo "Allow failure: ${rclone_allow_failure}" @@ -106,7 +108,7 @@ for destination in $destinations; do fi echo "Target: ${rclone_target}" # shellcheck disable=2086 - rclone copy "${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=$? if [[ "${rclone_allow_failure}" = "true" && $copy_rc -gt 0 ]]; then echo "Rclone copy failed. Switching to next destination." diff --git a/tag b/tag index 9084fa2..26aaba0 100644 --- a/tag +++ b/tag @@ -1 +1 @@ -1.1.0 +1.2.0